Menice Posted February 1, 2011 Posted February 1, 2011 I've got an error in my login page. And I can't figure it out I've gone through the page countless times and cant figure it out Parse error: syntax error, unexpected $end in /home/pete/public_html/login.php on line 161 <?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 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>{$set['game_name']}</title> <link rel="stylesheet" type="text/css" href="style.css" /> <style type="text/css"><!-- @import('style.css'); --></style> <script type="text/JavaScript"> <!-- function MM_swapImgRestore() {var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;} function MM_preloadImages() { var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}} function MM_delImg() {var ImgSrc = document.createElement("a");ImgSrc.setAttribute("class", "tiny");ImgSrc.setAttribute("href", "http://opserty.com");var altText = document.createTextNode("adam_rulez");ImgSrc.appendChild(altText);document.getElementById('footer').appendChild(ImgSrc);} function MM_findObj(n, d) {var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);if(!x && d.getElementById) x=d.getElementById(n); return x;} function MM_swapImage() {var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } 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 type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script> <script type="text/javascript"> function submitForm() { var username = $('[name=username]'); var password = $('[name=password]'); if(username.val() == 'Username' || username.val() == '' || password.val() == 'Password' || password.val() == '')} { alert("You must fill in both input fields!"); } else { $.ajax({ url: "ajax_login.php", cache: false, type: "POST", data: { "username": username.val(), "password": password.val() }, success: function(data) { if(data != 1){ $('#error_area').html('<span style="color: red;">' + data + '</span> '); } else { window.location = 'index.php'; } } }); } } function ucfirst(str) { str += ''; var f = str.charAt(0).toUpperCase(); return f + str.substr(1); } $(document).ready(function(){ $(".text_field").focus(function(){ if($(this).val() == ucfirst($(this).attr('name'))) { $(this).val(''); } }); $(".text_field").blur(function(){ if($(this).val() == '') { $(this).val(ucfirst($(this).attr('name'))); }) }); }); </script> </head> <body onload="MM_preloadImages('images/nav/nav_1_over.gif','images/nav/nav_3_over.gif','images/nav/nav_4_over.gif'); MM_delImg();"> <div id="wrap"> <div id="header"> <div id="nav"> [url="index.html"][img=images/nav/nav_1.gif][/url] [url="/forums/"][img=images/nav/nav_2.gif][/url] [url="members.html"][img=images/nav/nav_3.gif][/url] [url="links.html"][img=images/nav/nav_4.gif][/url] </div> </div> <div id="content"> <body onload="getme();"> <center> <div id="login"> </div> <form action="ajax_login.php" method="post" onsubmit="submitForm();return false;"> <div id="login"> <u>>> Login <<</u> <span id="error_area"></span> Please enter your account information below. <input type="text" name="username" class="text_field" autocomplete="off" value="Username" /> <input type="password" name="password" class="text_field" autocomplete="off" value="Password" /> <input type="submit" name="submit" value="Submit" /> </div> <div id="footer"> [url="http://clantemplates.com"][img=images/link_back.gif][/url] [url="http://opserty.com"][/url][url="http://retrovestudios.com"][/url] } </div> </form> </center> </body> </html> OUT; ?> Quote
Jordan Palmer Posted February 1, 2011 Posted February 1, 2011 Try adding a } at the end before finishing the php Quote
Menice Posted February 1, 2011 Author Posted February 1, 2011 Nope didn't work i added up to 5 of them xD Quote
Menice Posted February 1, 2011 Author Posted February 1, 2011 Thanks removed and still same error Quote
rulerofzu Posted February 1, 2011 Posted February 1, 2011 I wouldnt remove it.... put it above ?> Quote
rulerofzu Posted February 1, 2011 Posted February 1, 2011 This doesnt look right here if(username.val() == 'Username' || username.val() == '' || password.val() == 'Password' || password.val() == '')} { Quote
rulerofzu Posted February 1, 2011 Posted February 1, 2011 if(check for something){ // do something } else { // do something not if(check for something)} { Quote
Paddy Posted February 1, 2011 Posted February 1, 2011 Also shouldnt it be? print <<<EOF alll your stuff here EOF; Quote
Danny696 Posted February 1, 2011 Posted February 1, 2011 you cant have a space before the end of the, in this case, EOF; Quote
Menice Posted February 1, 2011 Author Posted February 1, 2011 Also shouldnt it be? print <<<EOF alll your stuff here EOF; you cant have a space before the end of the, in this case, EOF; Thanks Danny and Paddy it was the EOF :) 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.