Waleed Baig Posted June 28, 2012 Share Posted June 28, 2012 Hey there,I am new to PHP scripting,I was following a Youtube PHP News system tutorial,But then In codes me and others are having errors i.e Undifined index:uid. The code is: <?php session_start(); mysql_connect("localhost","root",""); mysql_select_db("news_system"); ?> <html> <head> <title>News System</title> <link href='Stylesheet1.css' type='text/css' rel='stylesheet' </head> <body> <center> <table> <tr> <td id='body'> <h1>New System</h1> <td id='nav'> <?php if(!$_SESSION['uid']) { ?> <a href="?page=login">Login</a> <?php} else { ?> <a href="?page=logout">Logout</a> <?php } ?> </td> </td> </tr> </table> </center> </body> </html> If any body like to help,We would be glad for that help Quote Link to comment Share on other sites More sharing options...
memfiss Posted June 28, 2012 Share Posted June 28, 2012 ur $_SESSION['uid'] doesn't isset , u should check it <?php session_start(); mysql_connect("localhost","root",""); mysql_select_db("news_system"); if (!isset($_SESSION['uid'])) $_SESSION['uid'] = null; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.