SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Guru glenngould's Avatar
    Join Date
    Nov 2005
    Posts
    661
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    pagex->do something->go back to pagex

    I want to execute a script and go back to the page where it is accessed from.

    In other words:

    pagex->pagey (the script) do something->go back to pagex

    How to do it?

    I am rewriting my dynamic links to directory type URLs, if it makes a difference.
    Tweep List adds an avatar menu to Twitter (open source) ---------- Word Stats shows your most used words on Twitter

  2. #2
    SitePoint Evangelist
    Join Date
    Aug 2005
    Posts
    453
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use a handler script, in other word use a form or hypertext link to access a page containing a script to execute. After processing use the header() to go wherever you want.
    Computers and Fire ...
    In the hands of the inexperienced or uneducated,
    the results can be disastrous.
    While the professional can tame, master even conquer.

  3. #3
    SitePoint Guru glenngould's Avatar
    Join Date
    Nov 2005
    Posts
    661
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    use the header() to go wherever you want.
    But that depends on where I am coming from! Lets say I am at:

    example.com/pagex.php?this=is_where_i_am

    In that page I have a link to:

    example.com/dosomething.php?with=this_query

    So I click it and that's it. Now I want to go back to where I was which is:

    example.com/pagex.php?this=is_where_i_am


    This reminds me a well known quote lol:
    Quote Originally Posted by Lewis Caroll / Alice in Wonderland
    "Would you tell me, please, which way I ought to go from here?"
    "That depends a good deal on where you want to get to," said the Cat.
    Tweep List adds an avatar menu to Twitter (open source) ---------- Word Stats shows your most used words on Twitter

  4. #4
    SitePoint Evangelist
    Join Date
    Aug 2005
    Posts
    453
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use a hidden value in a form, use a session variable. There are any number of ways to capture and keep the referring URL.
    Computers and Fire ...
    In the hands of the inexperienced or uneducated,
    the results can be disastrous.
    While the professional can tame, master even conquer.

  5. #5
    SitePoint Wizard wonshikee's Avatar
    Join Date
    Jan 2007
    Posts
    1,223
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    You can use $_SERVER['HTTP_REFERER'] to find out where you can from.


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
  •