SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Zealot
    Join Date
    Apr 2006
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Navigation Problem

    Hi all , i want to get the "Back Url" , or in another terms the link that user has pressed to come to this page here is an example

    Page 1 , Page 2

    if the user click on Page1 , I want to Know the URL of Page 1 In Page2 code , how can i do this ?

  2. #2
    SitePoint Zealot
    Join Date
    Mar 2007
    Posts
    192
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i think the $_SERVER['REFERRER'] would do that

  3. #3
    SitePoint Zealot
    Join Date
    Apr 2006
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i didn't find any thing like that

  4. #4
    SitePoint Zealot
    Join Date
    Mar 2007
    Posts
    192
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    sorry its $_SERVER['HTTP_REFERER']

    http://www.php.net/reserved.variables

  5. #5
    SitePoint Evangelist superuser2's Avatar
    Join Date
    Aug 2006
    Posts
    598
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That might be a good solution. However,
    a) Not all browsers send referrers (because they can't)
    b) Some people disable the sending of referrer headers
    c) What if Page 2 is accessed directly?

    Isn't there a javascript "back" function?

  6. #6
    SitePoint Zealot
    Join Date
    Apr 2006
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I will give you more details , iam creating a control panel , when you open it it lists alot of items and each item has a delete link which will refer to another page to delete it , i want from the page that will delet it to frist delete it and return to the page that lists the item with the same query string

  7. #7
    SitePoint Wizard wheeler's Avatar
    Join Date
    Mar 2006
    Location
    Gold Coast, Australia
    Posts
    1,369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well you go to your delete script, then you specify the return URL in the query string. eg. delete.php?id=33&return=page1.php

    then you use
    PHP Code:
    // delete item here
    header("Location: page1.pp"); 
    BEFORE any output on the delete page. Be warned that you need to authenticate the return URL so that it is not open to manipulation
    Studiotime - Time Management for Web Developers
    to-do's, messages, invoicing, reporting - 30 day free trial!
    Thomas Multimedia Web Development


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •