sheraz Posted March 5, 2010 Share Posted March 5, 2010 Sir, i am trying to redirect toa page after the username and password varification, but it is not working. i have used include() function but it is loading the page in same page. i am using header () function it is not displaying anything. Please guide me how to solve it. Here is the code <?php if($_POST['name']!="" AND $_POST['password']!="" ) { $nm=$_POST['name']; $pw=$_POST['password']; $con=mysql_connect("localhost","",""); $select=mysql_select_db("tulip"); $qry=mysql_query("select * from admin"); $result=mysql_fetch_row($qry); if($nm==$result[0] AND $pw==$result[1]) { header('admin.php'); } else { header('errorlog.php'); } } else header('errorlog.php'); ?> :-\ Link to comment https://forums.phpfreaks.com/topic/194282-how-to-redirect-to-another-page/ Share on other sites More sharing options...
newrehmi Posted March 5, 2010 Share Posted March 5, 2010 try put header('location:admin') Link to comment https://forums.phpfreaks.com/topic/194282-how-to-redirect-to-another-page/#findComment-1022069 Share on other sites More sharing options...
GingerRobot Posted March 5, 2010 Share Posted March 5, 2010 The header() function can send a variety of data to the browser. As the the manual page illustrates, you must tell the browser what data it is you are sending. For example: header("Location:http://www.example.com"); Link to comment https://forums.phpfreaks.com/topic/194282-how-to-redirect-to-another-page/#findComment-1022071 Share on other sites More sharing options...
sheraz Posted March 5, 2010 Author Share Posted March 5, 2010 ahhaa. I got it. thanks sir ;D Link to comment https://forums.phpfreaks.com/topic/194282-how-to-redirect-to-another-page/#findComment-1022079 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.