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. Link to comment https://forums.phpfreaks.com/topic/177533-need-solution-in-this-script/ 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> Link to comment https://forums.phpfreaks.com/topic/177533-need-solution-in-this-script/#findComment-936062 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.