Parse error: parse error, unexpected T_STRING, expecting ','

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
falvarado
Forum Newbie
Posts: 2
Joined: Thu Nov 06, 2003 6:07 pm

Parse error: parse error, unexpected T_STRING, expecting ','

Post by falvarado »

Could someone please help??

this is the error:
Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /usr/home/americansall/docs/admin_modrecord.php3 on line 596


This is what is on that line:
<form name="form" action="admin_modrecord2.php3" onSubmit="return wordFilter('form',['ASD','School_Name','Principal_Salutation','Principal_First','Principal_Middle','Principal_Last','Principal_Email','Address','Address2','City','State','Zip','Phone','Fax','Email','Enrollment','School_Type','Lower_Grade','Upper_Grade','updated']);">

Thanks.
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

can you give us 2 or 3 lines above that too?
falvarado
Forum Newbie
Posts: 2
Joined: Thu Nov 06, 2003 6:07 pm

Post by falvarado »

";

}else{




echo "



<form name="form" action="admin_modrecord2.php3" onSubmit="return wordFilter('form',['ASD','School_Name','Principal_Salutation','Principal_First','Principal_Middle','Principal_Last','Principal_Email','Address','Address2','City','State','Zip','Phone','Fax','Email','Enrollment','School_Type','Lower_Grade','Upper_Grade','updated']);">

<table border=0 cellpadding=0 cellspacing=0 width=400>
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

u need to escape the quotes

Code: Select all

";
}
else { 
echo "<form name="form" action="admin_modrecord2.php3" onSubmit="return wordFilter('form',['ASD','School_Name','Principal_Salutation','Principal_First','Principal_Middle','Principal_Last','Principal_Email','Address','Address2','City','State','Zip','Phone','Fax','Email','Enrollment','School_Type','Lower_Grade','Upper_Grade','updated']);"> 

<table border="0" cellpadding="0" cellspacing="0" width="400">
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

You forgot a few, but yeah. Escaping quotes or using a different quote for the echo.

eg.

Code: Select all

<?php
echo '<img src="images/picture.gif" border="0" width="50" height="50">';
?>
Though not escaped, it wouldn't return any parse errors.

Reference material: http://www.php.net/manual/en/language.types.string.php
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

Where did i forget some?

the 's dont need to be escaped..
Post Reply