k3v0 Posted June 10, 2008 Share Posted June 10, 2008 I have a hosting account with Godaddy and I created a support ticketing system for my site. Well, it all worked until I woke up one day and it didn't work. The code is all the same. Godaddy said nothing in my site changed. I have backups of everything and have tried on a buddies server of mine and it works perfectly. Is there any reason why this code will not work. I go to my site and i enter /login.php?action=login All I get is a blank white screen. Any help PLEEAAASSEEE I've spent hours on this and would love for it to work again. Remember it works perfectly on another server. Look below for code. <? /* -------------------------------------------------------------- NAME: login.php DATE: 04/29/08 DESC: This page will log them into the system */ if ($action == "login") { #display login page echo " <html> <head> <title>Ticket System ::: Login</title> <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'> <style type='text/css'> .standard { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; } </style> </head> <body> <table width='100%' height='100%' border='0' cellpadding='3' cellspacing='0'> <tr> <td align='center' valign='middle'><table width='400' border='0' cellspacing='0' cellpadding='3'> <tr> <td bgcolor='#996600' class='standard'><strong><font color='#FFFFFF'>Ticket System Login</font></strong></td> </tr> <tr> <td bgcolor='#99CC66' class='standard'> <form name='form1' method='post' action='login.php'> <table width='100%' border='0' cellspacing='0' cellpadding='3'> <tr class='standard'> <td width='23%'><strong>Username:</strong></td> <td width='77%'><input name='username' class='standard' type='text' id='username' size='25' maxlength='15'></td> </tr> <tr class='standard'> <td><strong>Password:</strong></td> <td><input name='password' class='standard' type='password' id='password' size='20' maxlength='12'></td> </tr> <tr class='standard'> <td> </td> <td> <div align='right'> <input type='hidden' name='action' value='auth'> <input type='submit' name='Submit' value='Login'> <input type='hidden' name='ticket_transport' value='$ticket_transport'> </div></td> </tr> </table> </form></td> </tr> <tr> <td bgcolor='#FFFFFF' class='standard'><div align='center'><font color='#993300' size='2' face='Verdana, Arial, Helvetica, sans-serif'><strong>$message</strong></font></div></td> </tr> </table></td> </tr> </table> </body> </html> "; } // end of action if ($action == "auth") { include("library/includes/db.php"); #DB Include // Query // $get = mysql_query( " SELECT * FROM `lm_employee` WHERE `username` = \"$_POST[username]\" AND `password` = \"$_POST[password]\" ") or die (myql_error()); $data = mysql_fetch_array($get); $count = mysql_num_rows($get); // Lets log them in depending on the results // if ($count == 1) { // this is good lets log them in # set cookie parms - AUTH $authValue = 1; setcookie("AUTH", $authValue); # set cookie parms - ACCESS_LEVEL $accessValue = "$data[access_level]"; setcookie("ACCESS", $accessValue); # set cookie parms - USER $userValue = "$data[username]"; setcookie("USER", $userValue); # set cookie parms - USER $first_name_sess = "$data[first_name]"; setcookie("FIRST_NAME_SESS", $first_name_sess); # set cookie parms - USER $last_name_sess = "$data[last_name]"; setcookie("LAST_NAME_SESS", $last_name_sess); # set cookie parms - USER $sales_only = "$data[sales_only]"; setcookie("SALES_ONLY", $sales_only); # set cookie parms - USER $no_transfer = "$data[no_transfer]"; setcookie("NO_TRANSFER", $no_transfer); # set cookie parms - EID $eData = "$data[EID]"; setcookie("EID", $eData); // Send them to the main page // if($ticket_transport == ""){ header("Location:welcome.php"); exit; } else{ header("Location: ticket.php?action=viewTicket&TID=$ticket_transport"); exit; } } else { // send them back for some reason # set cookie parms - AUTH $authValue = 1; setcookie("AUTH", $authValue, time()-7200); # set cookie parms - ACCESS_LEVEL $accessValue = "$data[access_level]"; setcookie("ACCESS", $accessValue, time()-7200); # set cookie parms - USER $userValue = "$data[username]"; setcookie("USER", $userValue, time()-7200); # set cookie parms - EID $eData = "$data[EID]"; setcookie("EID", $eData, time()-7200); // The password was bad try it again // header("Location:login.php?ticket_transport=$ticket_transport&action=login&message=Wrong%20Username%20and%20Password"); exit; } // end of logging them } // end of ACTION if ($action == "logout") { # set cookie parms - AUTH $authValue = 1; setcookie("AUTH", $authValue, time()-7200); # set cookie parms - ACCESS_LEVEL $accessValue = "$data[access_level]"; setcookie("ACCESS", $accessValue, time()-7200); # set cookie parms - USER $userValue = "$data[username]"; setcookie("USER", $userValue, time()-7200); # set cookie parms - EID $eData = "$data[EID]"; setcookie("EID", $eData, time()-7200); // The password was bad try it again // header("Location:login.php?action=login&message=Logout%20Successful"); exit; } // end of action ?> Link to comment https://forums.phpfreaks.com/topic/109504-i-need-some-help-pleaseee/ Share on other sites More sharing options...
kenrbnsn Posted June 10, 2008 Share Posted June 10, 2008 This looks like it's coded with the assumption that register_globals is enabled. That hasn't been the default for over 5 years. You should replace "$action" with "$_GET['action']". You should also replace the start tag "<?" with "<?php" Ken Link to comment https://forums.phpfreaks.com/topic/109504-i-need-some-help-pleaseee/#findComment-561700 Share on other sites More sharing options...
k3v0 Posted June 10, 2008 Author Share Posted June 10, 2008 Ok, that displayed it now.... But it wont let me log in. When I hit login, it is redirecting me to login.php without an action so it is not displaying anything. <?php /* -------------------------------------------------------------- NAME: login.php DATE: 04/29/08 DESC: This page will log them into the system */ if ($_GET['action'] == "login") { #display login page echo " <html> <head> <title>Ticket System ::: Login</title> <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'> <style type='text/css'> <!-- .standard { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; } --> </style> </head> <body> <table width='100%' height='100%' border='0' cellpadding='3' cellspacing='0'> <tr> <td align='center' valign='middle'><table width='400' border='0' cellspacing='0' cellpadding='3'> <tr> <td bgcolor='#996600' class='standard'><strong><font color='#FFFFFF'>Ticket System Login</font></strong></td> </tr> <tr> <td bgcolor='#99CC66' class='standard'> <form name='form1' method='post' action='login.php'> <table width='100%' border='0' cellspacing='0' cellpadding='3'> <tr class='standard'> <td width='23%'><strong>Username:</strong></td> <td width='77%'><input name='username' class='standard' type='text' id='username' size='25' maxlength='15'></td> </tr> <tr class='standard'> <td><strong>Password:</strong></td> <td><input name='password' class='standard' type='password' id='password' size='20' maxlength='12'></td> </tr> <tr class='standard'> <td> </td> <td> <div align='right'> <input type='hidden' name='action' value='auth'> <input type='submit' name='Submit' value='Login'> <input type='hidden' name='ticket_transport' value='$ticket_transport'> </div></td> </tr> </table> </form></td> </tr> <tr> <td bgcolor='#FFFFFF' class='standard'><div align='center'><font color='#993300' size='2' face='Verdana, Arial, Helvetica, sans-serif'><strong>$message</strong></font></div></td> </tr> </table></td> </tr> </table> </body> </html> "; } // end of action if ($_GET['action'] == "auth") { include("library/includes/db.php"); #DB Include // Query // $get = mysql_query( " SELECT * FROM `lm_employee` WHERE `username` = \"$_POST[username]\" AND `password` = \"$_POST[password]\" ") or die (myql_error()); $data = mysql_fetch_array($get); $count = mysql_num_rows($get); // Lets log them in depending on the results // if ($count == 1) { // this is good lets log them in # set cookie parms - AUTH $authValue = 1; setcookie("AUTH", $authValue); # set cookie parms - ACCESS_LEVEL $accessValue = "$data[access_level]"; setcookie("ACCESS", $accessValue); # set cookie parms - USER $userValue = "$data[username]"; setcookie("USER", $userValue); # set cookie parms - USER $first_name_sess = "$data[first_name]"; setcookie("FIRST_NAME_SESS", $first_name_sess); # set cookie parms - USER $last_name_sess = "$data[last_name]"; setcookie("LAST_NAME_SESS", $last_name_sess); # set cookie parms - USER $sales_only = "$data[sales_only]"; setcookie("SALES_ONLY", $sales_only); # set cookie parms - USER $no_transfer = "$data[no_transfer]"; setcookie("NO_TRANSFER", $no_transfer); # set cookie parms - EID $eData = "$data[EID]"; setcookie("EID", $eData); // Send them to the main page // if($ticket_transport == ""){ header("Location:welcome.php"); exit; } else{ header("Location: ticket.php?action=viewTicket&TID=$ticket_transport"); exit; } } else { // send them back for some reason # set cookie parms - AUTH $authValue = 1; setcookie("AUTH", $authValue, time()-7200); # set cookie parms - ACCESS_LEVEL $accessValue = "$data[access_level]"; setcookie("ACCESS", $accessValue, time()-7200); # set cookie parms - USER $userValue = "$data[username]"; setcookie("USER", $userValue, time()-7200); # set cookie parms - EID $eData = "$data[EID]"; setcookie("EID", $eData, time()-7200); // The password was bad try it again // header("Location:login.php?ticket_transport=$ticket_transport&action=login&message=Wrong%20Username%20and%20Password"); exit; } // end of logging them } // end of ACTION if ($_GET['action'] == "logout") { # set cookie parms - AUTH $authValue = 1; setcookie("AUTH", $authValue, time()-7200); # set cookie parms - ACCESS_LEVEL $accessValue = "$data[access_level]"; setcookie("ACCESS", $accessValue, time()-7200); # set cookie parms - USER $userValue = "$data[username]"; setcookie("USER", $userValue, time()-7200); # set cookie parms - EID $eData = "$data[EID]"; setcookie("EID", $eData, time()-7200); // The password was bad try it again // header("Location:login.php?action=login&message=Logout%20Successful"); exit; } // end of action ?> Link to comment https://forums.phpfreaks.com/topic/109504-i-need-some-help-pleaseee/#findComment-561720 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.