Alienware Posted February 6, 2009 Share Posted February 6, 2009 Ok so im trying to write an auto responder for my website... so if an admin has the auto responder turned on.. the member that sends the message gets a message up saying that we are busy but will respond when we are able to (somethign like that)... I created the message and the alternate options... I am getting line errors when i load the page! cany ANYBODY help!!??? im at my wits end! here is the code- <?php require("commBan.php.inc"); require("connections/db.php"); require("connections/require.php"); $qry = mysql_query("SELECT * FROM `players` WHERE `playername` = '$player' LIMIT 1")or die(mysql_error()); $arr = mysql_fetch_array($qry); $from = $_GET['to']; $rep = $_GET['rep']; if ($rep){ $que = mysql_query("SELECT * FROM `inbox` WHERE `id` = '$rep' LIMIT 1")or die(mysql_error()); $ary = mysql_fetch_array($que); $from = $ary['from']; $tit = $ary['title']; $on = $ary['date']; } $submit = strip_tags($_POST['submit']); $user = strip_tags($_POST['user']); $title = addslashes($_POST['title']); $msg = addslashes(strip_tags($_POST['msg'])); if ($submit){ if (!$user){ $error = "Please specify which player you wist to send a message to."; error($error); }elseif ($user){ if (!$title){ $title = "None"; } if (!$msg){ $error = "Please enter a messagAe to send."; error($error); }elseif ($msg){ if (ereg("[^A-Za-z0-9]", $user)){ $error = "Playername can only contain alphanumeric characters."; error($error); }elseif (!ereg("[^A-Za-z0-9]", $user)){ $chk = mysql_query("SELECT `id` FROM `players` WHERE `playername` = '$user' LIMIT 1")or die(mysql_error()); $exist = mysql_numrows($chk); if ($exist == 0){ $error = "That player does not exist."; error($error); }elseif ($exist == 1){ mysql_query("INSERT INTO `inbox` ( `id` , `playername` , `from` , `title` , `message` , `read` , `date` , `protected` ) VALUES ( '' , '$user' , '$player' , '$title' , '$msg' , '0' , '$date' , '0' )")or die(mysql_error()); $auto = mysql_query("SELECT * FROM `players` WHERE `Autoreply` = '$aut' LIMIT 1")or die(mysql_error()); if ($aut == 0){ $upd = "Message sent to <a href=\"profile.php?player=".$user."\" target=\"main\">".$user."."; upd($upd); )elseif ($aut == 1){ $autorep = "Message sent to <a href=\"profile.php?player=".$user."\" target=\"main\">".$user."."<br><br>Thank you for taking the time to message us!<br>As we recieve such a high amount of messages a day we are not always able to respond to all messages immediately<br> If your question is of the non urgent type then please feel free to use the Helpdesk or message a HDO for further assistance! <br>Thank you for understanding.<br> NYM Staff." }}}}} ?> Thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/144135-desperate-for-help-getting-line-errors/ Share on other sites More sharing options...
Maq Posted February 6, 2009 Share Posted February 6, 2009 I am getting line errors when i load the page! Before examining your code, what exactly are the "line errors" saying? Quote Link to comment https://forums.phpfreaks.com/topic/144135-desperate-for-help-getting-line-errors/#findComment-756284 Share on other sites More sharing options...
Alienware Posted February 6, 2009 Author Share Posted February 6, 2009 Parse error: syntax error, unexpected ')' in /home2/nymobste/public_html/send_msgtest.php on line 67 Quote Link to comment https://forums.phpfreaks.com/topic/144135-desperate-for-help-getting-line-errors/#findComment-756285 Share on other sites More sharing options...
premiso Posted February 6, 2009 Share Posted February 6, 2009 It is never good to do a }}}} to close braces. Indentation is the way to go. It just makes it harder to debug. You need to get a syntax highlighting program, if you had one, you would notice the error here: $autorep = "Message sent to <a href=\"profile.php?player=".$user."\" target=\"main\">".$user."."<br><br>Thank you for taking the time to message us!<br>As we recieve such a high amount of messages a day we are not always able to respond to all messages immediately<br> If your question is of the non urgent type then please feel free to use the Helpdesk or message a HDO for further assistance! <br>Thank you for understanding.<br> NYM Staff." Which should be: $autorep = "Message sent to <a href=\"profile.php?player=".$user."\" target=\"main\">".$user."<br><br>Thank you for taking the time to message us!<br>As we recieve such a high amount of messages a day we are not always able to respond to all messages immediately<br> If your question is of the non urgent type then please feel free to use the Helpdesk or message a HDO for further assistance! <br>Thank you for understanding.<br> NYM Staff."; Quote Link to comment https://forums.phpfreaks.com/topic/144135-desperate-for-help-getting-line-errors/#findComment-756306 Share on other sites More sharing options...
Maq Posted February 6, 2009 Share Posted February 6, 2009 You need to get a syntax highlighting program, if you had one, you would notice the error here: Exactly, you can clearly see the color change of the text. What are you using BTW? Quote Link to comment https://forums.phpfreaks.com/topic/144135-desperate-for-help-getting-line-errors/#findComment-756307 Share on other sites More sharing options...
dennismonsewicz Posted February 6, 2009 Share Posted February 6, 2009 I would recommend Dreamweaver (as it has phenomenal syntax highlighting) but if you are looking for something FREE I would go with notepad++.. IMO yall Quote Link to comment https://forums.phpfreaks.com/topic/144135-desperate-for-help-getting-line-errors/#findComment-756310 Share on other sites More sharing options...
premiso Posted February 6, 2009 Share Posted February 6, 2009 I would recommend Dreamweaver (as it has phenomenal syntax highlighting) but if you are looking for something FREE I would go with notepad++.. IMO yall lol Dreamweaver, worst program ever in my books. But I am also not a web designer, so yea. Notepad++ has my go all the way. For big projects, Eclipse with PHP plugin works wonderfully Quote Link to comment https://forums.phpfreaks.com/topic/144135-desperate-for-help-getting-line-errors/#findComment-756318 Share on other sites More sharing options...
Maq Posted February 6, 2009 Share Posted February 6, 2009 If you want to get into PHP editors, go here!: Which PHP-Editor do you think is the best? Quote Link to comment https://forums.phpfreaks.com/topic/144135-desperate-for-help-getting-line-errors/#findComment-756320 Share on other sites More sharing options...
dennismonsewicz Posted February 6, 2009 Share Posted February 6, 2009 I would recommend Dreamweaver (as it has phenomenal syntax highlighting) but if you are looking for something FREE I would go with notepad++.. IMO yall lol Dreamweaver, worst program ever in my books. But I am also not a web designer, so yea. Notepad++ has my go all the way. For big projects, Eclipse with PHP plugin works wonderfully Well I don't use the Design part for web design, YOU SHOULD NEVER USE A WYSIWYG for web design! that is a VERY bad practice! LEARN SOME CODE! LOL Quote Link to comment https://forums.phpfreaks.com/topic/144135-desperate-for-help-getting-line-errors/#findComment-756322 Share on other sites More sharing options...
Alienware Posted February 7, 2009 Author Share Posted February 7, 2009 hmmm... im still getting the error Quote Link to comment https://forums.phpfreaks.com/topic/144135-desperate-for-help-getting-line-errors/#findComment-756432 Share on other sites More sharing options...
Alienware Posted February 7, 2009 Author Share Posted February 7, 2009 nothing seems to be working... perhaps i have written it completely wrong :S the code worked fine untill i included the new bit to send the new message... but now im just getting line errors Quote Link to comment https://forums.phpfreaks.com/topic/144135-desperate-for-help-getting-line-errors/#findComment-756470 Share on other sites More sharing options...
Prismatic Posted February 7, 2009 Share Posted February 7, 2009 If you want to get into PHP editors, go here!: Which PHP-Editor do you think is the best? It's such a let down Nusphere PhpED is never listed. It's such a great PHP IDE Quote Link to comment https://forums.phpfreaks.com/topic/144135-desperate-for-help-getting-line-errors/#findComment-756473 Share on other sites More sharing options...
ngreenwood6 Posted February 7, 2009 Share Posted February 7, 2009 I think you have an error on this line as well: )elseif ($aut == 1){ The ) should be a } like this: }elseif ($aut == 1){ Quote Link to comment https://forums.phpfreaks.com/topic/144135-desperate-for-help-getting-line-errors/#findComment-756477 Share on other sites More sharing options...
landavia Posted February 7, 2009 Share Posted February 7, 2009 1. what error message now? 2. please copy-paste the file here.. example above Parse error: syntax error, unexpected ')' in /home2/nymobste/public_html/send_msgtest.php on line 67 u copy paste "send_msgtest.php" 3. try view the original file in the site.. perhaps the size you should have and size in server are different? )elseif ($aut == 1){ }elseif ($aut == 1){ ??? Quote Link to comment https://forums.phpfreaks.com/topic/144135-desperate-for-help-getting-line-errors/#findComment-756481 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.