[prev in list] [next in list] [prev in thread] [next in thread]
List: php-general
Subject: [PHP] RE: Solved. [PHP] Multiple word strings getting truncated - help please.
From: "James Johnson" <james () smb-studios ! com>
Date: 2003-08-30 22:42:15
[Download RAW message or body]
Hi David,
>From your suggestion, I found the problem. I'm validating the form and if
something isn't correct, I'm not doing the query, but maintaining what the
user previously entered with the following code:
<?php if(isset($_POST['addr1'])){$a1 = $_POST['addr1'];}else{$a1 = "";}?>
<input type="text" name="addr1" size="32" value="<?php echo $a1; ?>">
In some of the input tags, I hadn't put quotes around the value.
Thanks,
James
-----Original Message-----
From: David Otton [mailto:phpmail@jawbone.freeserve.co.uk]
Sent: Saturday, August 30, 2003 3:24 PM
To: James Johnson
Cc: php-general@lists.php.net
Subject: Re: [PHP] Multiple word strings getting truncated - help please.
On Sat, 30 Aug 2003 14:52:30 -0700, you wrote:
>I have a form for a member to signup for an account. The form has
>standard fields for addresses, city state, etc. When I insert the data
>into the table, if the string has more than one word, it gets truncated
>to the first word.
>
>Does this sound like a PHP or a MySQL problem.
>
>Here's the code: (partial as the query is quite long)
Odd. Try this
$tr_addr1 = mysql_escape_string ($_POST['addr1']);
$query = "INSERT INTO subscribers (addr1) VALUES('$tr_addr1')"; echo
("$query<br>");
And tell us what you get. Then you at least know whether it's a MySQL
problem or an HTML/PHP problem.
Hmm. You are quoting your HTML attributes, right? That's the only thing I
can think of that even comes close to the behaviour you describe.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic