I don't get the complete variables
Moderator: General Moderators
-
reddurango
- Forum Newbie
- Posts: 13
- Joined: Sun Aug 16, 2009 9:17 am
I don't get the complete variables
Hi good day i'm having a problem with the post and get methods 'cause i'm sending information trough this mehtods but it arrived incomplete, for example i send "Las Flores" and only arrives "Las" is like if the space did a break, help please
Re: I don't get the complete variables
Post some code? How you are sending (via a HTML form -then post the HTML, or via a script - then post a script), how you are using the variable (post the script)
-
reddurango
- Forum Newbie
- Posts: 13
- Joined: Sun Aug 16, 2009 9:17 am
Re: I don't get the complete variables
well this is the thing i'm using forms, and i use a hidden line for send the information like this:
This code prints: Hotel: Las Flores (and hidden is the input)
as you can see i print the text and is complete but when i send the form trough POST and i get it in this code:
This prints: Hotel: Las
Here only shows 'til the first space
Code: Select all
<td>Hotel: </td><td><?php echo $hotel ?><input type="hidden" name="hotel" value=<?php echo $hotel ?>></td>as you can see i print the text and is complete but when i send the form trough POST and i get it in this code:
Code: Select all
$message.=" Hotel: " . $_POST['hotel'] . "\n";Here only shows 'til the first space
Re: I don't get the complete variables
You are missing the quotes in the value attribute of the input, this is why you are losing everything after the first space. It should be:
Or even better:
Code: Select all
<td>Hotel: </td><td><?php echo $hotel ?><input type="hidden" name="hotel" value="<?php echo $hotel ?>"></td>Code: Select all
<td>Hotel: </td><td><?php echo htmlspecialchars($hotel) ?><input type="hidden" name="hotel" value="<?php echo htmlspecialchars($hotel) ?>"></td>