protek123 Posted February 24, 2010 Posted February 24, 2010 I have tried my best to fix it myself but i failed! #Pudda is currently trying to fix it for me... File #Login.php Code <?php session_start(); include "config.php"; global $_CONFIG; define("MONO_ON", 1); require "class/class_db_{$_CONFIG['driver']}.php"; $db=new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c=$db->connection_id; $set=array(); $settq=$db->query("SELECT * FROM settings"); while($r=$db->fetch_row($settq)) { $set[$r['conf_name']]=$r['conf_value']; } print <<<EOF <!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> <title>{$set['game_name']}</title> <script language="JavaScript"> <!-- function getCookieVal (offset) { var endstr = document.cookie.indexOf (";", offset); if (endstr == -1) endstr = document.cookie.length; return unescape(document.cookie.substring(offset, endstr)); } function GetCookie (name) { var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; while (i < clen) { var j = i + alen; if (document.cookie.substring(i, j) == arg) return getCookieVal (j); i = document.cookie.indexOf(" ", i) + 1; if (i == 0) break; } return null; } function SetCookie (name,value,expires,path,domain,secure) { document.cookie = name + "=" + escape (value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : ""); } function DeleteCookie (name,path,domain) { if (GetCookie(name)) { document.cookie = name + "=" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT"; } } // --> </script> <script language="JavaScript"> var usr; var pw; var sv; function getme() { usr = document.login.username; pw = document.login.password; sv = document.login.save; if (GetCookie('player') != null) { usr.value = GetCookie('username') pw.value = GetCookie('password') if (GetCookie('save') == 'true') { sv[0].checked = true; } } } function saveme() { if (usr.value.length != 0 && pw.value.length != 0) { if (sv[0].checked) { expdate = new Date(); expdate.setTime(expdate.getTime()+(365 * 24 * 60 * 60 * 1000)); SetCookie('username', usr.value, expdate); SetCookie('password', pw.value, expdate); SetCookie('save', 'true', expdate); } if (sv[1].checked) { DeleteCookie('username'); DeleteCookie('password'); DeleteCookie('save'); } } else { alert('You must enter a username/password.'); return false; } } </script> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> <!-- .over { background-image: url(images/nav2.gif); } body { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xxx-small; color: #FFFFFF; font-family:calibri, helvetica, arial, geneva, sans-serif; font-size: xxx-small;;color: black; } table,tr,td { font-family:helvetica, arial, geneva, sans-serif;font-size: 12px; } img { border:none; } textarea { font-family:helvetica, arial, geneva, sans-serif;font-size:12px;color: black; } a:link { font-weight: bold; color: 5A9F00; text-decoration: none; } a:hover { font-weight: bold; color: #FFFFFF; } a:visited { color: 5A9F00; } .table { background-color:#000000; } .table3 { background-color:#000000; } .table td { background-color:#DEDEDE; height:22px; } .table3 td { background-color:#CCCCCC; } td .alt { background-color:#EEEEEE; height:22px; } td .h { background-image:url(tablehgrad.png); background-repeat:repeat-x; font-weight: bold; background-color: #D6D6D6; } .table th { background-image:url(tablehgrad.png); background-repeat:repeat-x; font-weight: bold; background-color: #D6D6D6; } --> </style> <style type="text/css"> <!-- input { font-family: Verdana, Arial, Helvetica, sans-serif; color: #FFFFFF; border: 1px; background-color: #4A4A4A; } --> </style> </head> <body bgcolor="#262626" onLoad="MM_preloadImages('images/showshoutboxover.gif')"> <table width="95" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td>[img=images/topleftheader.jpg]</td> <td>[img=images/topdigitanimated.gif] [img=images/topbaranimated.gif]</td> <td>[img=images/toprightheader.jpg]</td> </tr> </table></td> </tr> <tr> <td>[img=images/header_blank.jpg]</td> </tr> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td>[img=images/tleftm.gif]</td> <td valign="top">[img=images/bottombaranimated.gif] [url="#"][img=images/showshoutbox_blank.gif][/url] </td> <td>[img=images/tlrightm.gif]</td> </tr> </table></td> </tr> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="172" valign="top"> [/b]</font></div></td> </tr> </table> </td> </tr> </table></td> <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" background="images/mcbg.gif"> <tr> <td>[img=images/maincontent_blank.gif]</td> </tr> <tr> <td><table width="95%" height="100%" border="0" align="top" cellpadding="0" cellspacing="1"> <tr> <td width="10%" ><div align="center"><font size="1"> EOF; $IP = ($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; if(file_exists('ipbans/'.$IP)) { die("[b]<font color=red size=+1>Your IP has been banned, there is no way around this.</font>[/b]</body></html>"); } $year=date('Y'); print "<h3>> {$set['game_name']} Log-In</h3> <table width=50%> <tr> <td width=50%> <fieldset> <legend>About {$set['game_name']}</legend> {$set['game_description']} </fieldset> </td> <td> <fieldset> <legend>Login</legend>"; print "<form action=authenticate.php method=post name=login onsubmit=\"return saveme();\">Username: <input type=text name=username> Password: <input type=password name=password> Remember me? <input type=\"radio\" value=\"ON\" name=\"save\">Yes <input type=\"radio\" name=\"save\" value=\"OFF\" checked>No <input type=submit value=Submit></form></fieldset></td></tr></table> <h3>[url='register.php']REGISTER NOW![/url]</h3> [i]<center>Powered by codes made by Dabomstew (© {$year}). Game Copyright ©{$year} {$set['game_owner']}.</center>[/i]"; print <<<OUT [/b]</font></div></td> </tr> </table> </tr> </table></td> <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" background="images/mcbg.gif"> <tr> <td>[img=images/copyright_do_not_remove.gif]</td> </tr> <tr> <td><table width="95%" height="100%" border="0" align="top" cellpadding="0" cellspacing="1"> <tr> <td width="10%" ><div align="center"><font size="1"> <tr> <td><table width="95%" height="100%" border="0" align="top" cellpadding="0" cellspacing="1"> <tr> <td width="10%" ><div align="center"><font size="1"> <td colspan="3"> <table cellpadding="0" cellspacing="0" border="0" width="100%"> <tr> <td class="dgradl"></td> <td class="dgrad"></td> <td class="dgradr"></td> </tr> </table> </td> </tr> </table> </body> </html> OUT; ?> Screenie Of the Problem Quote
Joshua Posted February 24, 2010 Posted February 24, 2010 gah is everyone using that flippin layout >< Quote
Jordan Palmer Posted February 24, 2010 Posted February 24, 2010 gah is everyone using that flippin layout >< It's rally horrible init? haha xD Quote
seanybob Posted February 24, 2010 Posted February 24, 2010 Well... First, all the javascript and junk for cookies is unnecessary. If I remember correctly, the default McCodes login page was (and is) crap. The login form worked, and that was it - none of the cookies stuff worked, you'll have to recode your own for that if you want it (but it's not necessary, the session is stored just fine). So in reality, all you need is the form and the elements within it from the McCodes code. I'd say grab that template again, start from the beginning on it, and just insert your login form into it (instead of all the code from the mccodes login.php). Quote
Dayo Posted February 24, 2010 Posted February 24, 2010 try this <?php session_start(); include "config.php"; global $_CONFIG; define("MONO_ON", 1); require "class/class_db_{$_CONFIG['driver']}.php"; $db=new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c=$db->connection_id; $set=array(); $settq=$db->query("SELECT * FROM settings"); while($r=$db->fetch_row($settq)) { $set[$r['conf_name']]=$r['conf_value']; } print <<<EOF <!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> <title>{$set['game_name']}</title> <script language="JavaScript"> <!-- function getCookieVal (offset) { var endstr = document.cookie.indexOf (";", offset); if (endstr == -1) endstr = document.cookie.length; return unescape(document.cookie.substring(offset, endstr)); } function GetCookie (name) { var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; while (i < clen) { var j = i + alen; if (document.cookie.substring(i, j) == arg) return getCookieVal (j); i = document.cookie.indexOf(" ", i) + 1; if (i == 0) break; } return null; } function SetCookie (name,value,expires,path,domain,secure) { document.cookie = name + "=" + escape (value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : ""); } function DeleteCookie (name,path,domain) { if (GetCookie(name)) { document.cookie = name + "=" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT"; } } // --> </script> <script language="JavaScript"> var usr; var pw; var sv; function getme() { usr = document.login.username; pw = document.login.password; sv = document.login.save; if (GetCookie('player') != null) { usr.value = GetCookie('username') pw.value = GetCookie('password') if (GetCookie('save') == 'true') { sv[0].checked = true; } } } function saveme() { if (usr.value.length != 0 && pw.value.length != 0) { if (sv[0].checked) { expdate = new Date(); expdate.setTime(expdate.getTime()+(365 * 24 * 60 * 60 * 1000)); SetCookie('username', usr.value, expdate); SetCookie('password', pw.value, expdate); SetCookie('save', 'true', expdate); } if (sv[1].checked) { DeleteCookie('username'); DeleteCookie('password'); DeleteCookie('save'); } } else { alert('You must enter a username/password.'); return false; } } </script> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> <!-- .over { background-image: url(images/nav2.gif); } body { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xxx-small; color: #FFFFFF; font-family:calibri, helvetica, arial, geneva, sans-serif; font-size: xxx-small;;color: black; } table,tr,td { font-family:helvetica, arial, geneva, sans-serif;font-size: 12px; } img { border:none; } textarea { font-family:helvetica, arial, geneva, sans-serif;font-size:12px;color: black; } a:link { font-weight: bold; color: 5A9F00; text-decoration: none; } a:hover { font-weight: bold; color: #FFFFFF; } a:visited { color: 5A9F00; } .table { background-color:#000000; } .table3 { background-color:#000000; } .table td { background-color:#DEDEDE; height:22px; } .table3 td { background-color:#CCCCCC; } td .alt { background-color:#EEEEEE; height:22px; } td .h { background-image:url(tablehgrad.png); background-repeat:repeat-x; font-weight: bold; background-color: #D6D6D6; } .table th { background-image:url(tablehgrad.png); background-repeat:repeat-x; font-weight: bold; background-color: #D6D6D6; } --> </style> <style type="text/css"> <!-- input { font-family: Verdana, Arial, Helvetica, sans-serif; color: #FFFFFF; border: 1px; background-color: #4A4A4A; } --> </style> </head> <body bgcolor="#262626" onLoad="MM_preloadImages('images/showshoutboxover.gif')"> <table width="95" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td>[img=images/topleftheader.jpg]</td> <td>[img=images/topdigitanimated.gif] [img=images/topbaranimated.gif]</td> <td>[img=images/toprightheader.jpg]</td> </tr> </table></td> </tr> <tr> <td>[img=images/header_blank.jpg]</td> </tr> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td>[img=images/tleftm.gif]</td> <td valign="top">[img=images/bottombaranimated.gif] [url="#"][img=images/showshoutbox_blank.gif][/url] </td> <td>[img=images/tlrightm.gif]</td> </tr> </table></td> </tr> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="172" valign="top"> [/b]</font></div></td> </tr> </table> </td> </tr> </table></td> <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" background="images/mcbg.gif"> <tr> <td>[img=images/maincontent_blank.gif]</td> </tr> <tr> <td><table width="95%" height="100%" border="0" align="top" cellpadding="0" cellspacing="1"> <tr> <td width="10%" ><div align="center"><font size="1"> EOF; $IP = ($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; if(file_exists('ipbans/'.$IP)) { die("[b]<font color=red size=+1>Your IP has been banned, there is no way around this.</font>[/b]</body></html>"); } $year=date('Y'); print "<h3>> {$set['game_name']} Log-In</h3> <table width=50%> <tr> <td width=50%> <fieldset> <legend>About {$set['game_name']}</legend> {$set['game_description']} </fieldset> </td> <td> <fieldset> <legend>Login</legend>"; print "<form action=authenticate.php method=post name=login onsubmit=\"return saveme();\">Username: <input type=text name=username> Password: <input type=password name=password> Remember me? <input type=\"radio\" value=\"ON\" name=\"save\">Yes <input type=\"radio\" name=\"save\" value=\"OFF\" checked>No <input type=submit value=Submit></form></fieldset></td></tr></table> <h3>[url='register.php']REGISTER NOW![/url]</h3> [i]<center>Powered by codes made by Dabomstew (© {$year}). Game Copyright ©{$year} {$set['game_owner']}.</center>[/i]</table>"; print <<<OUT [/b]</font></div></td> </tr> </table> </tr> </table></td> <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" background="images/mcbg.gif"> <tr> <td>[img=images/copyright_do_not_remove.gif]</td> </tr> <tr> <td><table width="95%" height="100%" border="0" align="top" cellpadding="0" cellspacing="1"> <tr> <td width="10%" ><div align="center"><font size="1"> <tr> <td><table width="95%" height="100%" border="0" align="top" cellpadding="0" cellspacing="1"> <tr> <td width="10%" ><div align="center"><font size="1"> <td colspan="3"> <table cellpadding="0" cellspacing="0" border="0" width="100%"> <tr> <td class="dgradl"></td> <td class="dgrad"></td> <td class="dgradr"></td> </tr> </table> </td> </tr> </table> </body> </html> OUT; ?> Quote
Eternal Posted February 24, 2010 Posted February 24, 2010 lol <?php session_start(); include "config.php"; global $_CONFIG; define("MONO_ON", 1); require "class/class_db_{$_CONFIG['driver']}.php"; $db=new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c=$db->connection_id; $set=array(); $settq=$db->query("SELECT * FROM settings"); while($r=$db->fetch_row($settq)) { $set[$r['conf_name']]=$r['conf_value']; } echo' <!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> <title>'.$set['game_name'].'</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css" src="logincss.css" /> </head> <body bgcolor="#262626" onLoad="MM_preloadImages(\'images/showshoutboxover.gif\')"> <table width="95" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td>[img=images/topleftheader.jpg]</td> <td>[img=images/topdigitanimated.gif] [img=images/topbaranimated.gif]</td> <td>[img=images/toprightheader.jpg]</td> </tr> </table></td> </tr> <tr> <td>[img=images/header_blank.jpg]</td> </tr> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td>[img=images/tleftm.gif]</td> <td valign="top">[img=images/bottombaranimated.gif] [url="#"][img=images/showshoutbox_blank.gif][/url] </td> <td>[img=images/tlrightm.gif]</td> </tr> </table></td> </tr> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="172" valign="top"> [/b]</font></div></td> </tr> </table> </td> </tr> </table></td> <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" background="images/mcbg.gif"> <tr> <td>[img=images/maincontent_blank.gif]</td> </tr> <tr> <td><table width="95%" height="100%" border="0" align="top" cellpadding="0" cellspacing="1"> <tr> <td width="10%" ><div align="center"><font size="1"> '; $IP = $_SERVER['REMOTE_ADDR']; if(file_exists('ipbans/'.$IP)) { die("[b]<font color=red size=+1>Your IP has been banned, there is no way around this.</font>[/b]</body></html>"); } $year=date('Y'); print "<h3>> {$set['game_name']} Log-In</h3> <table width=50%> <tr> <td width=50%> <fieldset> <legend>About {$set['game_name']}</legend> {$set['game_description']} </fieldset> </td> <td> <fieldset> <legend>Login</legend>"; print "<form action=authenticate.php method=post name=login onsubmit=\"return saveme();\">Username: <input type=text name=username> Password: <input type=password name=password> Remember me? <input type=\"radio\" value=\"ON\" name=\"save\">Yes <input type=\"radio\" name=\"save\" value=\"OFF\" checked>No <input type=submit value=Submit></form></fieldset></td></tr></table> <h3>[url='register.php']REGISTER NOW![/url]</h3> [i]<center>Powered by codes made by Dabomstew (© {$year}). Game Copyright ©{$year} {$set['game_owner']}.</center>[/i]</table>"; echo' [/b]</font></div></td> </tr> </table> </tr> </table></td> <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" background="images/mcbg.gif"> <tr> <td>[img=images/copyright_do_not_remove.gif]</td> </tr> <tr> <td><table width="95%" height="100%" border="0" align="top" cellpadding="0" cellspacing="1"> <tr> <td width="10%" ><div align="center"><font size="1"> <tr> <td><table width="95%" height="100%" border="0" align="top" cellpadding="0" cellspacing="1"> <tr> <td width="10%" ><div align="center"><font size="1"> <td colspan="3"> <table cellpadding="0" cellspacing="0" border="0" width="100%"> <tr> <td class="dgradl"></td> <td class="dgrad"></td> <td class="dgradr"></td> </tr> </table> </td> </tr> </table> </body> </html> '; ?> logincss.css input { font-family: Verdana, Arial, Helvetica, sans-serif; color: #FFFFFF; border: 1px; background-color: #4A4A4A; } .over { background-image: url(images/nav2.gif); } body { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xxx-small; color: #FFFFFF; font-family:calibri, helvetica, arial, geneva, sans-serif; font-size: xxx-small;;color: black; } table,tr,td { font-family:helvetica, arial, geneva, sans-serif; font-size: 12px; } img { border:none; } textarea { font-family:helvetica, arial, geneva, sans-serif; font-size:12px; color: black; } a:link { font-weight: bold; color: 5A9F00; text-decoration: none; } a:hover { font-weight: bold; color: #FFFFFF; } a:visited { color: 5A9F00; } .table { background-color:#000000; } .table3 { background-color:#000000; } .table td { background-color:#DEDEDE; height:22px; } .table3 td { background-color:#CCCCCC; } td .alt { background-color:#EEEEEE; height:22px; } td .h { background-image:url(tablehgrad.png); background-repeat:repeat-x; font-weight: bold; background-color: #D6D6D6; } .table th { background-image:url(tablehgrad.png); background-repeat:repeat-x; font-weight: bold; background-color: #D6D6D6; } There you are now all that messy piece of shit is cleaned up you can now see what you have to do !! Quote
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.