Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2004
    Posts
    41

    Question Unanswered: Might be a formatting issue?

    Hi

    I am using this code snippet:

    $name = "John's Emporium";
    print "<td><input name='name' type='text' value='$name'></td>";

    It displays in a textbox that says:

    John

    Everything after and including the ' (apostrophe) is ommitted.
    How can I get it to print everything in a textbox?

    Thanks for any help?

  2. #2
    Join Date
    Dec 2004
    Posts
    27
    The problem is that the HTML parser don't know you don't want to exit the value field. You need to play with it a little. I've found that echo is easier on the parser as it don't take any special parameters where print has some optional parameters that you can pass to it.

    Try something like this,
    PHP Code:
    $name "John's Emporium";
    echo 
    "<td><input name='name' type='text' value='".$name."'></td>"
    let me know if that helps, if not we can try other ways to get it resolved.

  3. #3
    Join Date
    Aug 2004
    Location
    San Antonio, TX
    Posts
    84
    This works for me:

    PHP Code:
    $name "John's Emporium"
    echo 
    '<td><input name="name" type="text" value="'.$name.'"></td>'
    Last edited by ranbla; 02-14-05 at 09:57.

  4. #4
    Join Date
    Feb 2004
    Posts
    41
    Thanks for the help.

    The second response worked, with the apostrophe used first. Thanks Ranbla!

  5. #5
    Join Date
    Mar 2005
    Posts
    1

    holy cow!

    I was looking for this answer for a while, thank you for making my wildest dreams come true.

    O

Posting Permissions

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