newbie - page automatic redirection

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kingdm
Forum Commoner
Posts: 27
Joined: Thu Dec 03, 2009 9:32 am

newbie - page automatic redirection

Post by kingdm »

Good day everyone,

I'm new in php (just a few weeks ago), I have a question. I'm curious on how to do the redirecting page. Say I want my logout to automatically redirect into index in 3 seconds. Here is my logout code. Can someone guide me.

Code: Select all

<?php 
 
session_start(); 
unset($_SESSION['id']); 
unset($_SESSION['username']); 
unset($_SESSION['password']); 
     
session_destroy(); 
 
$display = "<center>" . "<br /><br /><br /><br/><br /><br /><br /><br/><br /><br />" . "<div id=\"stylized\" class=\"myform\"><br/><br /><br /><h1>You have successfully logout</h1>" . "<p></p>" . "<a href=\"index.php\"><img src=\"images/back.png\" align=\"center\" border=\"0\" /></center></a></div>" . "</center>"; 
 
?> 
<html> 
<head> 
<link rel="stylesheet" type="text/css" href="confirmation_style.css"  /> 
</head> 
<body> 
 
<?php echo $display;?> 
 
</body> 
</html>
kingdm
Forum Commoner
Posts: 27
Joined: Thu Dec 03, 2009 9:32 am

Re: newbie - page automatic redirection

Post by kingdm »

Thanks for the quick reply jackpf. I have it working great. Cheers mate.
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: newbie - page automatic redirection

Post by jackpf »

Not really like i did anything.... :p
:google:
Post Reply