yaygames Posted May 27, 2006 Share Posted May 27, 2006 I keep getting the following error when testing my form:[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Parse error: parse error, unexpected T_IF in sitename.com/join.php on line 88[/quote]Yes, there is an If statement on line 88, and it looks like this:[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]if($position == "Designer"){[/quote]But that has no error in it, I don't think....Please help!!!Thanks,YayGames Quote Link to comment https://forums.phpfreaks.com/topic/10551-keep-getting-parse-error-newbie-help/ Share on other sites More sharing options...
AndyB Posted May 27, 2006 Share Posted May 27, 2006 The error messages do not always point at the line with the error, simply the line at which 'something' was happening that is consistent with an earlier syntax mistake and the line number you get happens to be the first line that the php parser can't understand.Post a chunk of code that begins 10-15 lines before line 88 and someone can take a look. Quote Link to comment https://forums.phpfreaks.com/topic/10551-keep-getting-parse-error-newbie-help/#findComment-39353 Share on other sites More sharing options...
yaygames Posted May 27, 2006 Author Share Posted May 27, 2006 Here's the 15 lines of code before the if statement:[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]</center></div></body></html><?$1 = "email address protected";$2 = "email address protected";$3 = "email address protected";$4 = $_POST['zip'][/quote]Some of it is HTML, does that make a difference?Thanks,YayGames Quote Link to comment https://forums.phpfreaks.com/topic/10551-keep-getting-parse-error-newbie-help/#findComment-39448 Share on other sites More sharing options...
AndyB Posted May 27, 2006 Share Posted May 27, 2006 Your problem is caused by the variable names that start with a number.[a href=\"http://ca.php.net/manual/en/language.variables.php\" target=\"_blank\"]http://ca.php.net/manual/en/language.variables.php[/a][!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] Variable names follow the same rules as other labels in PHP. A valid variable name starts with a letter or underscore, followed by any number of letters, numbers, or underscores[/quote] Quote Link to comment https://forums.phpfreaks.com/topic/10551-keep-getting-parse-error-newbie-help/#findComment-39453 Share on other sites More sharing options...
yaygames Posted May 28, 2006 Author Share Posted May 28, 2006 [img src=\"style_emoticons/[#EMO_DIR#]/unsure.gif\" style=\"vertical-align:middle\" emoid=\":unsure:\" border=\"0\" alt=\"unsure.gif\" /] Help!! [img src=\"style_emoticons/[#EMO_DIR#]/unsure.gif\" style=\"vertical-align:middle\" emoid=\":unsure:\" border=\"0\" alt=\"unsure.gif\" /] Quote Link to comment https://forums.phpfreaks.com/topic/10551-keep-getting-parse-error-newbie-help/#findComment-39576 Share on other sites More sharing options...
AndyB Posted May 28, 2006 Share Posted May 28, 2006 Help? With what? The error is caused by the variable names that begin with a number. So, change the variable names!If there's another problem, be more descriptive than "help" or "it doesn't work" or even post more code. Quote Link to comment https://forums.phpfreaks.com/topic/10551-keep-getting-parse-error-newbie-help/#findComment-39579 Share on other sites More sharing options...
yaygames Posted May 28, 2006 Author Share Posted May 28, 2006 Hey. The variable names were just replacements for other names that contained personal info. They actually don't have any numbers in them ;-).Thanks,YayGames Quote Link to comment https://forums.phpfreaks.com/topic/10551-keep-getting-parse-error-newbie-help/#findComment-39580 Share on other sites More sharing options...
AndyB Posted May 28, 2006 Share Posted May 28, 2006 So ... what's the problem (specifically) and show us much much much more code than a few lines of html and some variables you renamed. How about showing lines 70-90 of your script. If what you show us isn't the real script let us know so we don't tell you how to fix things that only look wrong. Quote Link to comment https://forums.phpfreaks.com/topic/10551-keep-getting-parse-error-newbie-help/#findComment-39581 Share on other sites More sharing options...
yaygames Posted May 28, 2006 Author Share Posted May 28, 2006 [!--quoteo(post=377702:date=May 27 2006, 09:02 PM:name=AndyB)--][div class=\'quotetop\']QUOTE(AndyB @ May 27 2006, 09:02 PM) [snapback]377702[/snapback][/div][div class=\'quotemain\'][!--quotec--]So ... what's the problem (specifically) and show us much much much more code than a few lines of html and some variables you renamed. How about showing lines 70-90 of your script. If what you show us isn't the real script let us know so we don't tell you how to fix things that only look wrong.[/quote]Sorry about that [img src=\"style_emoticons/[#EMO_DIR#]/unsure.gif\" style=\"vertical-align:middle\" emoid=\":unsure:\" border=\"0\" alt=\"unsure.gif\" /]. Here are the 100 lines of code surrounding the if statement:[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] <div align="center"> <p><font color="#FFFFFF">Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text </font></p> <p align="center"><font color="#FFFFFF"><em>Thanks,<br> The Game Infantry Team </em></font></p> </div> </td> </tr> </table> </div> </td> </tr> <tr> <td width="800" height="100" align="center" background="../bottom.jpg"> <div align="center"> <table border="0" cellpadding="0" cellspacing="0" width="800" height="100"> <tr> <td width="800" height="50"> <p align="center"><font face="Arial" size="1"><a href="URL">HOME</a> | <a href="http://gameinfantry.50webs.com/about.htm">ABOUT</a> | <a href="URL">JOIN</a> | <a href="http://gameinfantry.50webs.com/team.htm">THE INFANTRY TEAM</a> | <a href="http://gameinfantry.50webs.com/submit.htm">SUBMIT</a> | <a href="URL">FORUM</a> | <a href="URL">CONTACT</a></font></td> </tr> <tr> <td width="800" height="50"> <p align="center"><font face="Arial" size="1">© 2006 Game Infantry</font></td> </tr> </table> </div> </td> </tr> </table> </center></div></body></html><?$adminaddress = "email address protected";$design_manager = "email address protected";$advertising_manager = "email address protected";$zip = $_POST['zip'][!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]if ($position == "Designer") {[!--colorc--][/span][!--/colorc--]mail("$adminaddress","$name Would Like to Join the Designing Team!", "$Name would like to join the $position team at Game Infantry First Name: $nameLast Name: $lastEmail: $emailPosition: $position , (If Other): $otherState: $stateCity: $cityAddress: $addressZip Code: $zipNickname (if any): $nicknameDate of Birth: $month $day, $year$Name commented:------------------------------$comments"); mail("$design_manager","$name Would Like to Join the Designing Team!", "-----------This Email Has Been Forwarded To You, Please Do Not Reply-----------$Name would like to join the $position team at Game Infantry First Name: $nameLast Name: $lastEmail: $emailPosition: $position , (If Other): $otherState: $stateCity: $cityAddress: $addressZip Code: $zipNickname (if any): $nicknameDate of Birth: $month $day, $year$name commented:------------------------------$comments"); }else if ($position == "Advertiser") {mail("$advertising_manager","$name Would Like to Join the Advertising Team!", "-----------This Email Has Been Forwarded To You, Please Do Not Reply-----------$Name would like to join the $position team at Game Infantry First Name: $nameLast Name: $lastEmail: $emailPosition: $position , (If Other): $otherState: $stateCity: $cityAddress: $addressZip Code: $zipNickname (if any): $nicknameDate of Birth: $month $day, $year$Name commented:------------------------------$comments"); [/quote]Thanks a lot,YayGames Quote Link to comment https://forums.phpfreaks.com/topic/10551-keep-getting-parse-error-newbie-help/#findComment-39582 Share on other sites More sharing options...
kenrbnsn Posted May 28, 2006 Share Posted May 28, 2006 You're missing the terminating semi-colon on this line: [code]<?php $zip = $_POST['zip'] ?>[/code]Ken Quote Link to comment https://forums.phpfreaks.com/topic/10551-keep-getting-parse-error-newbie-help/#findComment-39587 Share on other sites More sharing options...
yaygames Posted May 28, 2006 Author Share Posted May 28, 2006 That did it! Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/10551-keep-getting-parse-error-newbie-help/#findComment-39602 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.