Jump to content

Php Redirecting Users


PC Nerd

Recommended Posts

hey guys


i want to send users to another page i understand this can be done with header('location: .........'

how can i put a delay on this. eg relocate after 10 sec, so that i can display info on where the user is going before they go..


any help would be much appreciated.
Link to comment
Share on other sites



<?php

// refresh / redirect to an internal web page
// ------------------------------------------
header( 'refresh: 5; url=/webdsn/' );
echo '<h1>You will be re-directed in 5 seconds...</h1>';


// refresh / redirect to an internal web page
// ------------------------------------------
header( 'refresh: 3; url=/' ); # redirects to our homepage
echo '<h1>You will be re-directed in 3 seconds...</h1>';


// refresh / redirect to an external web page
// ------------------------------------------
header( 'refresh: 0; url=http://www.example.net' );
echo '<h1>You won\'t know what hit you!</h1>';
?>
Link to comment
Share on other sites

Dville the user ask for a 10 sec delay can you exsplain how yours delays cheers........................


Dville code is for redirecting only.

the code i posted is for redirecting set via a time ok like 10 sec set via the refresh rate............

good luck.
Link to comment
Share on other sites

[!--quoteo(post=389115:date=Jun 29 2006, 05:08 AM:name=Dville)--][div class=\'quotetop\']QUOTE(Dville @ Jun 29 2006, 05:08 AM) [snapback]389115[/snapback][/div][div class=\'quotemain\'][!--quotec--]
good point

[code]sleep(5); // wait for five seconds
header("Location: http://www.example.com"); // redirects you to example.com[/code]

im still new to this myself, but the above code works with a pause :p
[/quote]

sleep is not part of header but corect flashee lol
Link to comment
Share on other sites

Thanks Now i want to do a login page. Once the page opens it is sent login info. From there it connects to a databse, creates cookies and then relocates. If i use the header...... will the script still run through the db connect etc.?????


thanks for your previous replys, they'r rally halping
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.