strujillo Posted September 13, 2008 Share Posted September 13, 2008 So everthing worked good until i added the login script (By login script i mean the one that checks to make sure you logged in) to my home page. but when i added it it stopped working. Heres the code...It keepes giving me a redirect error. im so confused i dont know what to do. THIS IS EMAIL/INDEX.PHP <?php $title="Social Intelligence:Email"; //Sets up the title include("/xampp/htdocs/SI/onikz/housekeeping/template.php"); //Gets the template ?> <tr> <td colspan="1" valign="top" width="90%" id="content"><?php email(); //Calls the welcome function?></td> </tr> <tr> <td colspan="1" align="center" valign="top" width="90%" height="30" id="footer">© 2008 Onikz.com</td> </tr> </table> </body> </html> <?php function email(){ echo "This will be the email section!"; } ?> It messes up up there around the include section. when i took out the include section it worked, but i need the included statement in there. This is like my homemade template. After i added the login check script it started giving me redirect error, whenever i would logout and click on the link. <? //This code checks to make sure they are logged in BEFORE they can access the webpage session_start(); if(!isset($_SESSION['myusername'])){ //If he is not logged in, go to index.php header("location:index.php"); }else{ //If he is logged in do nothing and go on to the rest of the code. } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title><?php echo $title; ?></title> <style type="text/css"> a:hover{ color:white; background-color:#669900; text-decoration:underline; padding-right:18px; padding-left:2px; } a{ color:#669900; text-decoration:none; padding-left:2px; padding-right:18px; float:left; } #main-menu{ border-bottom:#CCCCCC; border-left:#CCCCCC; border:1px; background-color:#ffffff; } body{ color: #666666; font-family: arial,lucida grande,verdana,sans serif; font-size: 12px; line-height: 18px; background-color:#eee9bf; } h3{ margin:0; padding:0; } table{ border:1px; border-color:#CCCCCC; border-style:solid; } td#main-menu{ border-right-color:#ffffff; border-left-color:#ffffff; border-style:solid; border-top-color:#CCCCCC; background-color:#F7F7F7; } td#header{ padding-top:25px; background-color:#FFFFFF; } td#footer{ background-color:#F7F7F7; } td#content{ background-color:#FFFFFF; border-right-color:#F7F7F7; border-right-style:solid; border-width:10px; border-left-color:#F7F7F7; border-left-style:solid; } </style> </head> <body> <table cellpadding="0" cellspacing="1" width="100%" height="100%"> <tr > <td colspan="1" align="center" valign="top" width="90%" height="75" bordercolor="#FFFFFF" id="header"><font size="55">Social Intelligence</font></td> </tr> <tr > <td colspan="1" align="center" valign="top" width="90%" height="35" id="main-menu"><?php include("main_menu.php"); ?></Td> </tr> Link to comment https://forums.phpfreaks.com/topic/124093-problem-with-login-script/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.