Jump to content

Redirecting


Dat

Recommended Posts

I've run through this my head many times and I cannot find a simple solution.

 

I want to have this sort of redirect page that will redirect after a certain amount time, say 3 seconds, and in the direct page I want to display a message based on the previous page's message.

 

For example I have a profile page and users can edit their profile. When they click submit I want them to be directed to a page that tells them to wait 3 seconds and tell them their profile has been updated.

Link to comment
https://forums.phpfreaks.com/topic/114031-redirecting/
Share on other sites

Hope this helps:

 

Edit Page

<?php

if ( something ) {
$success[] = "You've done something right";
header( "Location: redirect.php?message=" . $success[0] );
}

?>

 

Redirect Page

<?php

header( "Refresh: 3; url=profile.php" );
print htmlentities( $_GET["message"], ENT_QUOTES );//htmlentities() for security

?>

Link to comment
https://forums.phpfreaks.com/topic/114031-redirecting/#findComment-586135
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.