Re: [PHP] text input truncated
On Nov 4, 2003, at 6:27 PM, Jay Frumkin wrote: Hi all, I am having a bit of a problem, and was wondering if you could help? Here's the sample code (very simple) ?php $xyz = Hello World; echo forminput type=test size=25 value=$xyz/form; ? The text box shows up with Hello NOT Hello World. How do I get the entire variable? If you look at the HTML returned, you'll probably see World at the very end of the input tag. To fix this, put quotes around the value attribute. Really, it's good practice to put quotes around all attribute values in HTML: echo forminput type=\test\ size=\25\ value=\$xyz\/form; HTH -- Chris Garaffa Nil Zero Heavy Industries http://moondrop.nilzero.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] text input truncated
Put quotes around all the values, like: echo forminput type='test' size='25' value='$xyz'/form; Martin -Original Message- From: Jay Frumkin [mailto:[EMAIL PROTECTED] Sent: Wednesday, 5 November 2003 10:28 AM To: '[EMAIL PROTECTED]' Subject: [PHP] text input truncated Hi all, I am having a bit of a problem, and was wondering if you could help? Here's the sample code (very simple) ?php $xyz = Hello World; echo forminput type=test size=25 value=$xyz/form; ? The text box shows up with Hello NOT Hello World. How do I get the entire variable? Thanks for your help, Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] text input truncated
On Tuesday, November 04, 2003 3:28 PM Jay wrote: echo forminput type=test size=25 value=$xyz/form; [snip] The text box shows up with Hello NOT Hello World. How do I get the entire variable? Hi Jay. You need to wrap the value attribute in quotes, or else it'll truncate at the first space. echo forminput type=text size=25 value=\$xyz\/form; Oh, and you'd also misspelled the type value text as test (which incidentally shows up as a text input anyways, since that's the default. Cheers, Pablo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] text input truncated
$xyz = Hello World; echo forminput type=test size=25 value=$xyz/form; ? The text box shows up with Hello NOT Hello World. How do I get the entire variable? I would try single quotes here. $xyz = 'Hello World'; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] text input truncated
Your html is very sloppy actually. Use: $xyz = 'Hello World'; echo 'forminput type=text size=25 value='.$xyz.'/form'; - Original Message - From: Daniel Clark To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, November 04, 2003 6:49 PM Subject: Re: [PHP] text input truncated $xyz = Hello World; echo forminput type=test size=25 value=$xyz/form; ? The text box shows up with Hello NOT Hello World. How do I get the entire variable? I would try single quotes here. $xyz = 'Hello World'; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] text input truncated
--- Daniel Clark [EMAIL PROTECTED] wrote: $xyz = Hello World; echo forminput type=test size=25 value=$xyz/form; The text box shows up with Hello NOT Hello World. How do I get the entire variable? I would try single quotes here. $xyz = 'Hello World'; That's good advice in general, but this error is the fault of the output of the variable, not its creation. HTML attributes (such as value) should be quoted. Always. Hope that helps. Chris = My Blog http://shiflett.org/ HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php