Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 6 of 6
  1. #1
    Senior Member ericbusch's Avatar
    Join Date
    Aug 2003
    Location
    Daejeon, South Korea
    Posts
    241
    Member #
    2779
    Is there a function available in Php that can remember where that page was called from.

    For example, I am making a small forum. If an un-logged in user tries to respond to a post they are sent to the login page. After they log in, how can i send them back to the page they were just on?

    Any ideas?
    Eric
    Blogs For Sale - Each blog is packed with 1000s of signatures and ads are highly integrated into the site. Great CTR! Completely customizable from Admin CP. On Sale!
    Complete Websites For Sale - Fantastic looking sites rich with content. Come complete with domain names. I only have a couple of these.

  2.  

  3. #2
    Senior Member
    Join Date
    Aug 2003
    Posts
    444
    Member #
    2801
    Look up the HTTP_REFERER environment variable. Try finding it in $_SERVER. I think that's the only (easy) way.
    eKstreme
    eKstreme.com - Free website tools!
    fontfox - free fonts Hand-picked quality fonts.

  4. #3
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    Note that some privacy applications block the referer, so you should never rely on it.

    The cleaner solution would be sessions.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  5. #4
    Senior Member rosland's Avatar
    Join Date
    Jul 2003
    Location
    Norway
    Posts
    1,944
    Member #
    2096
    If you want to set the current URL into a variable, You can use "$url = "http://".$HTTP_HOST.$PHP_SELF;". If your URL contain a variable like http://www.home.com/somepage.php?id=201, you would have to add ."?".$_SERVER['QUERY_STRING']; to the above, to include the variable.
    S. Rosland

  6. #5
    Senior Member ericbusch's Avatar
    Join Date
    Aug 2003
    Location
    Daejeon, South Korea
    Posts
    241
    Member #
    2779
    Once again, you have come through for me! Everything works great!

    Thanks, Eric
    Blogs For Sale - Each blog is packed with 1000s of signatures and ads are highly integrated into the site. Great CTR! Completely customizable from Admin CP. On Sale!
    Complete Websites For Sale - Fantastic looking sites rich with content. Come complete with domain names. I only have a couple of these.

  7. #6
    Senior Member iphong's Avatar
    Join Date
    Mar 2003
    Location
    Arlington, VA
    Posts
    751
    Member #
    916
    PHP Code:
    $uri $_SERVER['REQUEST_URI']; 
    This $uri will get the file name and all requests of the file
    for example the file is (showforum.php?fid=2&s=89791728938743ss23q), show you can return to where you were.

    I use this in my http://home.iphong.com after you login it will take you to where you were.
    Vu Tuan Phong
    iPhongDesign

    http://iphong.com
    http://adstudio1.com


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 05:34 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com