doforumda Posted October 13, 2009 Share Posted October 13, 2009 hi i have following script and i want to a problem in it. the problem is when this page first loads it displays this error `Notice: Undefined index: page in D:\wamp\www\dynamic\index1.php on line 26` and then it displays the content in home.php which is in else statment. this only occurs when the page loads for the first time. after that if i click any link it works fine. <body> <table width="70%" align="center"> <tr> <td> <h1>My Web Page</h1> </td> </tr> </table> <table width='70%' align="center"> <tr> <td width="13%" valign="top" align="left"> <b> <a href="index1.php?page=home">Home</a><br> <a href="index1.php?page=tutorials">Tutorials</a> </b> </td> <td width="87%" align="left"> <?php if($_GET["page"]) { $page = $_GET["page"]; include($page.".php"); } else { include("home.php"); } ?> </td> </tr> </table> </body> how this problem can be removed. Quote Link to comment Share on other sites More sharing options...
GKWelding Posted October 13, 2009 Share Posted October 13, 2009 change to <body> <table width="70%" align="center"> <tr> <td> <h1>My Web Page</h1> </td> </tr> </table> <table width='70%' align="center"> <tr> <td width="13%" valign="top" align="left"> <b> <a href="index1.php?page=home">Home</a><br> <a href="index1.php?page=tutorials">Tutorials</a> </b> </td> <td width="87%" align="left"> <?php if(isset($_GET["page"])) { $page = $_GET["page"]; include($page.".php"); } else { include("home.php"); } ?> </td> </tr> </table> </body> 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.