Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5

Thread: Syntax error

  1. #1
    New Coder
    Join Date
    May 2004
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Syntax error

    Hello

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

    Code:
    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:
    Code:
    Parse error: parse error, unexpected '<' in /home/elsowceo/public_html/customer/upload/do_upload.php on line 130
    This is line 130
    Code:
    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

  • #2
    New Coder
    Join Date
    Jun 2004
    Location
    Newcastle, England
    Posts
    72
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    Beauty is in the eye of the beer-holder

    Man who smoke pot, choke on handle

  • #3
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    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>";

  • #4
    New Coder
    Join Date
    Jun 2004
    Location
    Newcastle, England
    Posts
    72
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yup nightfire spotted 1 i didnt c as well
    Beauty is in the eye of the beer-holder

    Man who smoke pot, choke on handle

  • #5
    New Coder
    Join Date
    Apr 2004
    Location
    NC
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts
    PHP Code:
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •