Jump to content

redirect help


phpisawesome

Recommended Posts

one way, correcting previous post

 

<?php
session_start();
if ($_GET['show'] == 1) {
   echo $_SESSION['message']; //echos out Text from script
} else {
    $_SESSION['message'] = "Text from script"; //sets message to a session variable.
    header("Location: new_page.php?show=1"); //redirects to new_page.php in 0s
    exit;
}
?>

Link to comment
https://forums.phpfreaks.com/topic/120642-redirect-help/#findComment-622249
Share on other sites

So when I click the link I want it to perform the action on the php action page and on the page it redirects to display what it needs to display

 

So here's an example

 

Click here to add me as a friend!

 

So when you click here it does the action in the php file...and it redirects you to the main friends page but displaying the results from the action page...

Link to comment
https://forums.phpfreaks.com/topic/120642-redirect-help/#findComment-622261
Share on other sites

store the value that needs to appear on the second page, then retrieve it and display it on the second page. i would use a SESSION variable to store the value on the first page, then when the visitor arrives on the second page, i would echo the value of that SESSION variable. just like my example, but splitting it onto 2 pages instead of just 1 like I did.

Link to comment
https://forums.phpfreaks.com/topic/120642-redirect-help/#findComment-622414
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.