Zepo. Posted June 21, 2007 Share Posted June 21, 2007 Here's what i got. I hve index.php setting two session variables when you login. But when i put session_start(); on any other page to get the variables, it leaves me with a blank page. What could be causing this? Link to comment https://forums.phpfreaks.com/topic/56568-solved-blank-page/ Share on other sites More sharing options...
Illusion Posted June 21, 2007 Share Posted June 21, 2007 Can you post the code of other page. Link to comment https://forums.phpfreaks.com/topic/56568-solved-blank-page/#findComment-279378 Share on other sites More sharing options...
Zepo. Posted June 21, 2007 Author Share Posted June 21, 2007 Index.php : <? include("../config.php"); session_start(); $admin=check_login($admin); switch($action){ default: admin_main($admin); break; } function check_login($admin){ global $config; $sladderid="$admin[ladderid]"; $selected[$sladderid]="SELECTED"; if($admin[fail]){ $userip=getenv("REMOTE_ADDR"); $failed=" <font color='#FF0000' size='1'>(Incorrect Login $userip)</font>"; $adminlog[admin]="$admin[name]"; $adminlog[ladderid]="$admin[ladderid]"; $adminlog[details]="Failed Admin Login: Name: $admin[name] Ladder: $admin[ladderid] IP: $userip"; adminlog($adminlog); } $admin=mysql_query("SELECT * FROM staff WHERE name='$admin[name]' AND password='$admin[pass]' AND ladderid='$admin[ladderid]' AND rights > '0'"); $admin=mysql_fetch_array($admin); if($admin[ladderid]){ $ladder=mysql_query("SELECT name,isteam FROM ladders WHERE id='$admin[ladderid]'"); $ladder=mysql_fetch_array($ladder); $admin[laddername]="$ladder[name]"; $admin[isteam]="$ladder[isteam]"; } $admin[pass]="$admin[password]"; if(!$admin[id]){ //Lets Start Some Sessions $_SESSION[user] = '$admin[name]'; $_SESSION[rights] = '$admin[rights]'; $ladders=mysql_query("SELECT id,name FROM ladders WHERE active='2' ORDER BY name"); while(list($id,$name)=mysql_fetch_row($ladders)){ $ladderlist.="<option value='$id' $selected[$id]>$name</option>"; } echo "<html> <head> <title>Admin Control Panel Login</title> </head> <link type='text/css' rel='stylesheet' href='./css/manage.css' /> <body bgcolor='#cccccc' background='./images/bg.gif'> <br /> <br /> <br /> <br /> <form method='POST'> <table border='0' cellpadding='5' cellspacing='0' align='center' class='main'> <tr> <th colspan='2'>Login $failed</th> </tr> <tr> <td colspan='2' style='padding:0px; border-bottom:1px solid #666666; background-color:#ffffff;'> <table border='0' cellpadding='0' cellspacing='0' height='70'> <tr> <td width='195' background='/images/logo_blue_bg.gif'><img src='./images/logo_blue.gif' align='middle' border='0'></td> <td width='195' background='/images/logo_blue_bg2.gif'> Extreme Gaming Ladder Control Panel v1.0 </td> </tr> </table> </td> </tr> <tr> <td width='80'>Username:</td> <td><input type='text' name='admin[name]' size='50' value='$admin[name]' /></td> </tr> <tr> <td width='80'>Password:</td> <td><input type='password' name='admin[pass]' value='' size='50' /></td> </tr> <tr> <td> </td> <td><input type='hidden' name='admin[fail]' value='1'> <input type='hidden' name='action' value='adminlogin'> <input type='submit' name='submit' value='Login >>'></td> </tr> </table> </form> </body> </html>"; exit; } return($admin); } //ADMIN MAIN function admin_main($admin){ global $config; //Lets Start Some Sessions $_SESSION[user] = '$admin[name]'; $_SESSION[rights] = '$admin[rights]'; echo "<html> <head> <script type='text/javascript'> <!- // get out of any containing frameset if (self.parent.frames.length != 0) { self.parent.location.replace(document.location.href); } // --> </script> <title>Extreme Gaming Ladder Control Panel</title> <frameset cols='195,*' framespacing='0' border='0' frameborder='0' frameborder='no' border='0'> <frame src='./menu.php' name='frame_nav' id='frame_nav' scrolling='auto' frameborder='0' marginwidth='0' marginheight='0' border='no' /> <frameset rows='20,*' framespacing='0' border='0' frameborder='0' frameborder='no' border'0'> <frame src='./head.php' name='frame_head' id='frame_head' scrolling='no' noresize='noresize' frameborder='0' marginwidth='10' marginheight='0' border='no' /> <frame src='./admin.php' name='frame_main' id='frame_main' scrolling='yes' frameborder='0' marginwidth='10' marginheight='10' border='no' /> </frameset> </frameset> <noframes> <body> <p>Your browser does not support frames. Please get one that does!</p> </body> </noframes> </head> </html> "; } ?> menu.php <? include("../config.php"); session_start(); if ($_SESSION[name]) { echo " <html> <head> <base target='frame_main'> <link type='text/css' rel='stylesheet' href='./css/manage.css' /> <script type='text/javascript'> function mover(num) { document.getElementById('row_' + num).style.backgroundImage = 'url(/images/table_row_bg_over.gif)'; document.getElementById('arrow_' + num).src = '/images/arrow_on.gif'; } function mout(num) { document.getElementById('row_' + num).style.backgroundImage = ''; document.getElementById('arrow_' + num).src = '/images/arrow_off.gif'; } </script> </head> <body bgcolor='#cccccc' background='./images/bg.gif' style='padding:0px; margin:0px;' > <img src='./images/logo.gif' /><br /> <div align='center'> <br /> <style type='text/css'>optgroup,option {font-size:11px;}</style><form name='gameform' action='/menu.php' method='POST' target='frame_nav' style='margin:0px;'> <select name='game_id' onchange='document.gameform.submit();'> <optgroup label='Xbox360'><option value='1886' selected>Rainbow Six: Vegas</option> <option value='2064' >R6: Vegas</option> </optgroup></select> </form> Administration Menu </div> <br />"; if($admin[rights] = 5){ echo " <table border='0' cellpadding='1' cellspacing='0' width='175' align='center' class='menu'> <tr><th>My Space</th></tr> <tr><td id='row_1' name='row_2'><img src='./images/arrow_off.gif' width='10' height='9' id='arrow_2' name='arrow_2' /> <a href='./admin.php?act=notepad' onMouseOver='mover(2);' onMouseOut='mout(2);'>Personal Notepad</a></td></tr> </table><br /> <table border='0' cellpadding='1' cellspacing='0' width='175' align='center' class='menu'> <tr><th>Help Desk</th></tr> <tr><td id='row_2' name='row_3'><img src='./images/arrow_off.gif' width='10' height='9' id='arrow_3' name='arrow_3' /> <a href='./admin.php?act=newticket' onMouseOver='mover(3);' onMouseOut='mout(3);'>New Ticket</a></td></tr> </table><br /> <table border='0' cellpadding='1' cellspacing='0' width='175' align='center' class='menu'> <tr><th>Ladders</th></tr> <tr><td id='row_3' name='row_4'><img src='./images/arrow_off.gif' width='10' height='9' id='arrow_4' name='arrow_4' /> <a href='./admin.php?act=viewchallenge' onMouseOver='mover(4);' onMouseOut='mout(4);'>View Challenge</a></td></tr> </table> "; } echo " <img src='/images/table_row_bg_over.gif' width='0' height='0' border='1' style='visibility:hidden;' /> </body> </html>"; } ?> Link to comment https://forums.phpfreaks.com/topic/56568-solved-blank-page/#findComment-279382 Share on other sites More sharing options...
Zepo. Posted June 21, 2007 Author Share Posted June 21, 2007 Anyone????? Link to comment https://forums.phpfreaks.com/topic/56568-solved-blank-page/#findComment-279414 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.