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 8 of 8

Thread: unwanted /

  1. #1
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,046
    Thanks
    19
    Thanked 42 Times in 42 Posts

    unwanted /

    whats up with this line

    PHP Code:
    <LABEL for="subject">Subject:</LABEL><input id="subject" type="text" name="subject" value=<?php if (isset($_GET['subject']) && !empty($_GET['subject'])) { echo $_GET['subject'] . '" readonly" .'; } ?>         /><br />
    the page is at www.jamiewest.org.uk/contact.php
    its not there on http://www.jamiewest.org.uk/contact....bject=Whatever

  • #2
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by rafiki View Post
    whats up with this line

    PHP Code:
    <LABEL for="subject">Subject:</LABEL><input id="subject" type="text" name="subject" value=<?php if (isset($_GET['subject']) && !empty($_GET['subject'])) { echo $_GET['subject'] . '" readonly" .'; } ?>         /><br />
    the page is at www.jamiewest.org.uk/contact.php
    this give me this:
    Code:
    Parse error: syntax error, unexpected ';' in removed path because reveal unsafe and irelevant details for user users
    best regards
    Last edited by oesxyl; 03-08-2008 at 04:52 PM.

  • #3
    Senior Coder kbluhm's Avatar
    Join Date
    Apr 2007
    Location
    Philadelphia, PA, USA
    Posts
    1,509
    Thanks
    3
    Thanked 258 Times in 254 Posts
    Very simple. Use proper HTML and put the attribute values in double quotes. You use double quotes in every other attribute except for the value attribute. Why is that?

    PHP Code:
    <LABEL for="subject">Subject:</LABEL><input id="subject" type="text" name="subject" value="<?php if (isset($_GET['subject']) && !empty($_GET['subject'])) { echo $_GET['subject'] . '" readonly" .'; } ?>"         /><br />

  • #4
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    Put double quotes around your value parameter's value.

    Code:
    <input type="text" value="hi" /><br />
    (edit) wow, I was beaten by 2 within a minute

  • #5
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,046
    Thanks
    19
    Thanked 42 Times in 42 Posts
    check again, i was messing around with the code it works now atleast for me..

    PHP Code:
    <LABEL for="subject">Subject:</LABEL><input id="subject" type="text" name="subject" value="/*added to open*/<?php if (isset($_GET['subject']) && !empty($_GET['subject'])) { echo $_GET['subject'] . '"/*close " for value*/  "readonly"' ; } ?>         /><br />
    Last edited by rafiki; 03-08-2008 at 04:49 PM.

  • #6
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,046
    Thanks
    19
    Thanked 42 Times in 42 Posts
    thanks all its working correctly

  • #7
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by rafiki View Post
    check again, i was messing around with the code it works now atleast for me..
    I guess the problem is somewhere in fetching parametes from request.
    Did you use REQUEST_URI or similar to extract query string from it?

    best regards

  • #8
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,046
    Thanks
    19
    Thanked 42 Times in 42 Posts
    no... i think it was a case of just using ""'s correctly


  •  

    Posting Permissions

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