Francis Posted April 9, 2008 Share Posted April 9, 2008 <!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> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Refresh" content="5;url=index.php" /> <title>Feedback deleted • [FFA] Clan and Server</title> <style type="text/css"> <!-- .style1 { font-size: 18px; font-weight: bold; background-color: #666666; color: #FFFFFF; } .style2 { font-size: 18px; font-weight: bold; background-color: #CCCCCC; color: #FFFFFF; } .textheader { margin-left:auto 2.5px; } .text { margin-left:auto 5px; } --> </style> </head> <body> <?php if(!strcmp($_SERVER['REMOTE_ADDR'], "67.70.100.149")) { $con = mysql_connect("localhost","********","********"); if (!$con) { echo '<table width="70%" border="0" align="center" style="border: #000000 medium solid;"> <tr class="style1"> <td>Error!</td> </tr> <tr class="style2"> <td>The following error was found: <p>' . mysql_error() .'</p></td> </tr> </table>'; die('Could not connect: ' . mysql_error()); } else { mysql_select_db("gtasam_ffa", $con); $id = $_POST[PostID]; $query = "UPDATE `gtasam_ffa`.`feedback` SET `Comment` = '<removed>' WHERE `feedback`.`PostID`=$id"; mysql_query($query); mysql_close($con); echo '<table width="70%" border="0" align="center" style="border: #000000 medium solid;"> <tr class="style1"> <td>Information</td> </tr> <tr class="style2"> <td>Feedback succesfully deleted! You will be redirected in 5 seconds!<br />If nothing happens, please click <a href="index.php">here</a>. </td> </tr> </table>'; } } else { echo '<table width="70%" border="0" align="center" style="border: #000000 medium solid;"> <tr class="style1"> <td>Error!</td> </tr> <tr class="style2"> <td>The following error was found: <p>You tried to access a page that you are not allowed to access.</p> </td> </tr> </table>'; ?> </body> </html> Gives that: Parse error: syntax error, unexpected $end in ********/public_html/test/testing/delete.php on line 85 Link to comment https://forums.phpfreaks.com/topic/100242-solved-php-error-help/ Share on other sites More sharing options...
Cosizzle Posted April 9, 2008 Share Posted April 9, 2008 An end error 99% of the time means theres an error with your brackets "doh" Looks like you forgot the last one } else { echo '<table width="70%" border="0" align="center" style="border: #000000 medium solid;"> <tr class="style1"> <td>Error!</td> </tr> <tr class="style2"> <td>The following error was found: <p>You tried to access a page that you are not allowed to access.</p> </td> </tr> </table>'; ?> </body> </html> should be } else { echo '<table width="70%" border="0" align="center" style="border: #000000 medium solid;"> <tr class="style1"> <td>Error!</td> </tr> <tr class="style2"> <td>The following error was found: <p>You tried to access a page that you are not allowed to access.</p> </td> </tr> </table>'; } ?> </body> </html> Link to comment https://forums.phpfreaks.com/topic/100242-solved-php-error-help/#findComment-512535 Share on other sites More sharing options...
matto Posted April 9, 2008 Share Posted April 9, 2008 I think you need a curly bracket "}" before your last php tag Link to comment https://forums.phpfreaks.com/topic/100242-solved-php-error-help/#findComment-512537 Share on other sites More sharing options...
matto Posted April 9, 2008 Share Posted April 9, 2008 Thanks Cosizzle, looks like you got there first...... Link to comment https://forums.phpfreaks.com/topic/100242-solved-php-error-help/#findComment-512539 Share on other sites More sharing options...
Francis Posted April 9, 2008 Author Share Posted April 9, 2008 That's the problem, post updated. Now, other problem, my DB doesn't update. It does when I execute the code by myself through PHPMyAdmin. Link to comment https://forums.phpfreaks.com/topic/100242-solved-php-error-help/#findComment-512544 Share on other sites More sharing options...
Francis Posted April 9, 2008 Author Share Posted April 9, 2008 <!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> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Refresh" content="5;url=index.php" /> <title>Feedback deleted • [FFA] Clan and Server</title> <style type="text/css"> <!-- .style1 { font-size: 18px; font-weight: bold; background-color: #666666; color: #FFFFFF; } .style2 { font-size: 18px; font-weight: bold; background-color: #CCCCCC; color: #FFFFFF; } .textheader { margin-left:auto 2.5px; } .text { margin-left:auto 5px; } --> </style> </head> <body> <?php if(!strcmp($_SERVER['REMOTE_ADDR'], "67.70.100.149")) { $con = mysql_connect("localhost","********","********"); if (!$con) { echo '<table width="70%" border="0" align="center" style="border: #000000 medium solid;"> <tr class="style1"> <td>Error!</td> </tr> <tr class="style2"> <td>The following error was found: <p>' . mysql_error() .'</p></td> </tr> </table>'; die('Could not connect: ' . mysql_error()); } else { mysql_select_db("gtasam_ffa", $con); $id = $_POST[PostID]; $query = "UPDATE `gtasam_ffa`.`feedback` SET `Comment` = '<removed>' WHERE `feedback`.`PostID`=$id"; mysql_query($query); mysql_close($con); echo '<table width="70%" border="0" align="center" style="border: #000000 medium solid;"> <tr class="style1"> <td>Information</td> </tr> <tr class="style2"> <td>Feedback succesfully deleted! You will be redirected in 5 seconds!<br />If nothing happens, please click <a href="index.php">here</a>. </td> </tr> </table>'; } } else { echo '<table width="70%" border="0" align="center" style="border: #000000 medium solid;"> <tr class="style1"> <td>Error!</td> </tr> <tr class="style2"> <td>The following error was found: <p>You tried to access a page that you are not allowed to access.</p> </td> </tr> </table>'; } ?> </body> </html> Gives that: Parse error: syntax error, unexpected $end in ********/public_html/test/testing/delete.php on line 85 (edited by kenrbnsn to change tags to ) Link to comment https://forums.phpfreaks.com/topic/100242-solved-php-error-help/#findComment-512545 Share on other sites More sharing options...
Cosizzle Posted April 9, 2008 Share Posted April 9, 2008 this script SHOULD work id test it but has DB info in it... umm this is called delete.php right? Link to comment https://forums.phpfreaks.com/topic/100242-solved-php-error-help/#findComment-512558 Share on other sites More sharing options...
Francis Posted April 9, 2008 Author Share Posted April 9, 2008 Works perfect now. But, I have a problem. My comments are listed in my database. But, they are not echo'ed correctly. They are not echo'ed by time. I want them to echo correctly. http://test.gta-sa-mp.com/testing Link to comment https://forums.phpfreaks.com/topic/100242-solved-php-error-help/#findComment-512559 Share on other sites More sharing options...
Francis Posted April 9, 2008 Author Share Posted April 9, 2008 Anyone? Please? Link to comment https://forums.phpfreaks.com/topic/100242-solved-php-error-help/#findComment-512894 Share on other sites More sharing options...
Francis Posted April 9, 2008 Author Share Posted April 9, 2008 Works now, I used ORDER BY. Link to comment https://forums.phpfreaks.com/topic/100242-solved-php-error-help/#findComment-513096 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.