CodeGuru Forums -
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic Newsletters VB Forums Developer.com


Newest CodeGuru.com Articles:

  • Building Interactive UIs with ASP.NET Ajax: Rebinding Client-Side Events After a Partial Page Postback
  • Speed Up Repetitive Insert, Update, and Delete Query Statements
  • Binding Data to Silverlight 4.0 Controls Using ASP.NET MVC Framework 2.0
  • ADO.NET Data Services in the .NET Framework

  • Search CodeGuru:
     



    Go Back   CodeGuru Forums > Other Programming > Scripting - Server Side (PHP, Perl, etc.)
    FAQ Members List Calendar Search Today's Posts Mark Forums Read

    Scripting - Server Side (PHP, Perl, etc.) Discuss scripting on the server side. This can incldue PHP, Perl, and any server side scripting issues not covered in other forums.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1    
    Old October 5th, 2009, 07:07 PM
    deschmeyer deschmeyer is offline
    Junior Member
     
    Join Date: Oct 2009
    Posts: 2
    deschmeyer is an unknown quantity at this point (<10)
    php redirect based on a session var

    i have this... on my server...

    PHP Code:
    <?php
    session_start
    ();
    if(!isset(
    $_SESSION['referrer'])){
    //get the referrer
    if ($_SERVER['HTTP_REFERER']){
    $referrer = $_SERVER['HTTP_REFERER'];
    }else{
    $referrer = "http://www.mysite.com";
    }
    //save it in a session
    $_SESSION['referrer'] = $referrer; // store session data
    }
    ?>
    i need to make a new page that can recall this session['referrer'] and do a server redirect on it.
    How would i do this?

    Much thanks if you can help with any suggestions.

    Last edited by PeejAvery; October 9th, 2009 at 09:59 AM. Reason: Added PHP tags.
    Reply With Quote
      #2    
    Old October 5th, 2009, 08:06 PM
    deschmeyer deschmeyer is offline
    Junior Member
     
    Join Date: Oct 2009
    Posts: 2
    deschmeyer is an unknown quantity at this point (<10)
    Talking Re: php redirect based on a session var

    this works great, figured it out.

    PHP Code:
    <?php
    session_start
    ();
    //    echo $_SESSION['referrer'];

        
    $bob = $_SESSION['referrer'];
        echo
    '<META HTTP-EQUIV="Refresh" CONTENT="5; URL='.$bob.'">';
    ?><br><br>
    <?php
    echo "referrer =". $_SESSION['referrer']; //retrieve data
    ?>

    Last edited by PeejAvery; October 9th, 2009 at 09:59 AM. Reason: Added PHP tags.
    Reply With Quote
    Reply

    Bookmarks
    Go Back   CodeGuru Forums > Other Programming > Scripting - Server Side (PHP, Perl, etc.)


    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 02:11 AM.



    Acceptable Use Policy

    Internet.com
    The Network for Technology Professionals

    Search:

    About Internet.com

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers


    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.