savagenoob Posted January 5, 2009 Share Posted January 5, 2009 Maybe someone could figure this one out. I have been testing my site locally, then uploaded it to my godaddy hosting account and a couple of my pages are getting error 500's with a parse error unexpected $end. Here is one of the pages with this. <?php include("header.php"); ?> <?php require_once('config.php'); //Array to store validation errors $errmsg_arr = array(); //Validation error flag $errflag = false; //Connect to mysql server $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); if(!$link) { die('Failed to connect to server: ' . mysql_error()); } //Select database $db = mysql_select_db(DB_DATABASE); if(!$db) { die("Unable to select database"); } if(isset($_POST['submit'])) { $subject = mysql_escape_string($_POST['subject']); $catagory = mysql_escape_string($_POST['catagory']); $notes = mysql_escape_string($_POST['notes']); $status = "Open"; $agent = $_SESSION['SESS_MEMBER_ID']; $priority = mysql_escape_string($_POST['Priority']); $duedate=mysql_escape_string($_POST['duedate']); $query = "INSERT into tasks SET Subject='$subject', Status='$status', Catagory='$catagory', Notes='$notes', Agent='$agent', Priority='$priority', DueDate='$duedate'"; $result = mysql_query($query); echo mysql_error(); echo "<b>Thank you! Task Added Successfully!<br>You'll be redirected to Task Page after (3) Seconds"; echo "<meta http-equiv=Refresh content=3;url=tasks.php>"; } else { echo "<BR>"; echo "<font color=\"#000066\">All Tasks</font>"; $agent1 = $_SESSION['SESS_MEMBER_ID']; $query = "SELECT * FROM tasks WHERE Agent=$agent1 ORDER by Status DESC"; $result=mysql_query($query); while($myrow = mysql_fetch_assoc($result)) {//begin of loop $taskID=$myrow['ID']; $subject=$myrow['Subject']; $status=$myrow['Status']; $notes=$myrow['Notes']; $priority=$myrow['Priority']; $catagory=$myrow['Catagory']; $duedate=$myrow['DueDate']; $agent=$myrow['Agent']; ?> <table border="0"> <tr><th>Subject: </th><td><?php echo $subject;?><td><th>Status<td><?php echo $status;?><td><th>Priority<td><?php echo $priority;?><td><th>Catagory<td><?php echo $catagory;?><td><th>Due Date<td><?php echo $duedate;?><td><a href=taskclose.php?ID=$taskID>Close Task</a><td><a href=outlook.php?ID=$taskID>Export to Outlook Calendar</a></td></td></td></th></td></td></th></td></td></th></td></td></th></td></td></tr> </table> <? } } ?> <form method="post" action="<?php echo $_SERVER['PHP_SELF']?>"> <table border="0" cellspacing="0" cellpadding="2" align="left"> <tr><td><p>::NEW TASK</p></td><td> <tr><td>Subject: <tr><td><input name="subject" size="40" maxlength="255" value=""/> <td><p align=left>Catagory: </p><td> <select name="catagory"> <option value="Business">Business</option> <option value="Personal">Personal</option> </select></td></td></tr> <BR /> <tr><td> <p align=left>Notes: </p><td> <tr><td><textarea name="notes" cols="30" rows="3"></textarea></td></td> <tr><td><p>Priority:</p></td> <tr><td><select name="Priority"> <option value="High">High</option> <option value="Medium">Medium</option> <option value="Low">Low</option> </select> <tr><td>Due Date: <tr><td><input name="duedate" size="10" maxlength="10" value="" onFocus="javascript:vDateType='1'" onKeyUp="DateFormat(this,this.value,event,false,'1')" onBlur="DateFormat(this,this.value,event,true,'1')"/> <tr><td><input name="submit" type="submit" value="Add Task" /></td> </form> </body> </html> I know this error usually comes from messing up closing brackets, braces, ect but I cant see why this exact file works on my local apache/php5/mysql setup and not the godaddy php5 setup. Maybe something I'm missing in the php.ini settings? Quote Link to comment https://forums.phpfreaks.com/topic/139584-solved-php-error/ Share on other sites More sharing options...
castis Posted January 5, 2009 Share Posted January 5, 2009 if you have them, check your error logs. Im not sure where they're located on a godaddy setup but your error should definitely be in there. the code you posted doesnt seem to have anything that would cause a server error. what about your other two pages? Quote Link to comment https://forums.phpfreaks.com/topic/139584-solved-php-error/#findComment-730220 Share on other sites More sharing options...
Maq Posted January 5, 2009 Share Posted January 5, 2009 1) 71 Never close your table tag 2) 64 Never use short tags 3) 69 Missing semi-colon (not necessary) These shouldn't be the cause of your error. The error usually refers to what you mentioned in your first post (missing braces...). Quote Link to comment https://forums.phpfreaks.com/topic/139584-solved-php-error/#findComment-730229 Share on other sites More sharing options...
PFMaBiSmAd Posted January 5, 2009 Share Posted January 5, 2009 2) 64 Never use short tags It is likely that the unexpected $end error is caused by that because the php code after the <? tag is not seen as being code and that code is two }} which would generate that error. Be consistent in your coding and don't use short open tags. Quote Link to comment https://forums.phpfreaks.com/topic/139584-solved-php-error/#findComment-730252 Share on other sites More sharing options...
Maq Posted January 5, 2009 Share Posted January 5, 2009 It is likely that the unexpected $end error is caused by that because the php code after the tag is not seen as being code and that code is two }} which would generate that error. That would explain, then uploaded it to my godaddy hosting account because your server's version of PHP probably doesn't have short tags turned on. Quote Link to comment https://forums.phpfreaks.com/topic/139584-solved-php-error/#findComment-730267 Share on other sites More sharing options...
savagenoob Posted January 5, 2009 Author Share Posted January 5, 2009 Woot! Thanks guys... I'm an idiot. Thats why you get paid the big bucks Quote Link to comment https://forums.phpfreaks.com/topic/139584-solved-php-error/#findComment-730307 Share on other sites More sharing options...
Maq Posted January 5, 2009 Share Posted January 5, 2009 Woot! Thanks guys... I'm an idiot. Thats why you get paid the big bucks Big bucks, right... Quote Link to comment https://forums.phpfreaks.com/topic/139584-solved-php-error/#findComment-730319 Share on other sites More sharing options...
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.