Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using $_POST but end of string cut off

Status
Not open for further replies.

danmul

Programmer
Joined
Jan 16, 2003
Messages
89
Location
IE
Hi,

I use this code to retrieve a name from a previous form
$full_name = $_POST["full_name"];
but i have a problem if the name has a space
i.e. "John Smith" would only return "John"
I am retrieving this from a select box.
Thanks in advance
Daniel.
 
Are you placing quotes around your <option> tags' value parameters?

If your HTML looks like:

<select name="full_name">
<option value=John Smith>John Smith</option>
.
.
.
</select>

Then your browser assumes the value of the <option> tag is "John" and "Smith" is an unsupported attribute which it ignores.

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
I am using this code to populate the drop down from the DB
print "\t<OPTION value=$surname $forename>$surname $forename</option>\n";
Do u know if it is possible to put in the quotes without upsetting the print operation ??

Thanks again!

 
print "\t<OPTION value=\"$surname $forename\">$surname $forename</option>\n";


Bastien

Cat, the other other white meat
 
Thanks,

That sorted it out
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top