...

View Full Version : Syntax error



elso
06-08-2004, 04:21 PM
Hello

I am new to PHP. I am trying to add a few "print" lines in a php file.


print "<form name=selectform><input type=\"hidden\" name=\"selectmenu\" value=$url".$_FILES['img1']['name']."">";
print "<input type=button value=\"Item Select Item\" onClick=\"sendValue(this.form.selectmenu);\">";
print "</form>";


I am getting a syntax error as follows:

Parse error: parse error, unexpected '<' in /home/elsowceo/public_html/customer/upload/do_upload.php on line 130


This is line 130

print "<input type=button value=\"Item Select Item\" onClick=\"sendValue(this.form.selectmenu);\">";

Can someone point out what I am missing here?

Thank you
Nelson Quimby

MrShed
06-08-2004, 04:25 PM
On line 129 you've forgotten to escape a " almost right at the end of the line....this could very well be causing the trouble.

Nightfire
06-08-2004, 04:25 PM
print "<form name=selectform><input type=\"hidden\" name=\"selectmenu\" value=\"".$url.$_FILES['img1']['name']."\">";
print "<input type=button value=\"Item Select Item\" onClick=\"sendValue(this.form.selectmenu);\">";
print "</form>";

MrShed
06-08-2004, 04:26 PM
Yup nightfire spotted 1 i didnt c as well :p

Josh_
06-08-2004, 06:00 PM
print "<form name=selectform><input type=\"hidden\" name=\"selectmenu\" value=$url".$_FILES['img1']['name']."">";
print "<input type=button value=\"Item Select Item\" onClick=\"sendValue(this.form.selectmenu);\">";
print "</form>";
That is why you should use syntax highlighting.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum