Jump to content
Updating IPB tonight Read more... ×

Archived

This topic is now archived and is closed to further replies.

yaygames

Keep Getting Parse Error! [Newbie HELP!]

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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]



Share this post


Link to post
Share on other sites
[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\" /]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
[!--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>
&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.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: $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

Share this post


Link to post
Share on other sites
You're missing the terminating semi-colon on this line: [code]<?php $zip = $_POST['zip'] ?>[/code]

Ken

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.