Jump to content


Photo

Keep Getting Parse Error! [Newbie HELP!]


  • Please log in to reply
10 replies to this topic

#1 yaygames

yaygames
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 27 May 2006 - 01:59 AM

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

#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 27 May 2006 - 02:11 AM

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.
Legend has it that reading the manual never killed anyone.
My site

#3 yaygames

yaygames
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 27 May 2006 - 02:15 PM

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

#4 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 27 May 2006 - 02:41 PM

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]




Legend has it that reading the manual never killed anyone.
My site

#5 yaygames

yaygames
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 28 May 2006 - 12:46 AM

[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\" /]

#6 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 28 May 2006 - 12:54 AM

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.
Legend has it that reading the manual never killed anyone.
My site

#7 yaygames

yaygames
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 28 May 2006 - 12:59 AM

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

#8 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 28 May 2006 - 01:02 AM

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.
Legend has it that reading the manual never killed anyone.
My site

#9 yaygames

yaygames
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 28 May 2006 - 01:17 AM

[!--quoteo(post=377702:date=May 27 2006, 09:02 PM:name=AndyB)--][div class=\'quotetop\']QUOTE(AndyB @ May 27 2006, 09:02 PM) View Post[/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>
&nbsp;</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.....htm">ABOUT</a> | <a href="URL">JOIN</a> | <a href="http://gameinfantry....m/team.htm">THE
INFANTRY TEAM</a> | <a href="http://gameinfantry....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: $name
Last Name: $last
Email: $email
Position: $position , (If Other): $other
State: $state
City: $city
Address: $address
Zip Code: $zip
Nickname (if any): $nickname
Date 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: $name
Last Name: $last
Email: $email
Position: $position , (If Other): $other
State: $state
City: $city
Address: $address
Zip Code: $zip
Nickname (if any): $nickname
Date 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: $name
Last Name: $last
Email: $email
Position: $position , (If Other): $other
State: $state
City: $city
Address: $address
Zip Code: $zip
Nickname (if any): $nickname
Date of Birth: $month $day, $year

$Name commented:
------------------------------
$comments"); [/quote]

Thanks a lot,
YayGames

#10 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 28 May 2006 - 01:43 AM

You're missing the terminating semi-colon on this line:
<?php $zip = $_POST['zip'] ?>

Ken

#11 yaygames

yaygames
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 28 May 2006 - 02:33 AM

That did it! Thanks!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users