php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25857 Echo Will Not Display Space in Text Box
Submitted: 2003-10-13 16:14 UTC Modified: 2003-10-13 17:33 UTC
From: jrh303 at psu dot edu Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 4.3.2 OS: Knoppix3.2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jrh303 at psu dot edu
New email:
PHP Version: OS:

 

 [2003-10-13 16:14 UTC] jrh303 at psu dot edu
Description:
------------
When using an echo command to output a multi word string (a phrase with spaces) echo will only output up to the first space when embedded within an html textbox.

There is no problem if the html is included in the echo statement, for example-- 

echo"<input type=\"text\" tabindex=\"4\"         name=\"ClientLastName\" value= \"" .$row["ClientLastName"] ."\">";

Reproduce code:
---------------
<input  type="text" name="some_string" value = <? echo($row["some_string_with_spaces"]);?> >

Expected result:
----------------
<textbox>Whole Phrase With Spaces</textbox>

Actual result:
--------------
<textbox>Whole</textbox>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-10-13 17:33 UTC] elmicha@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

Put your value in double quotes:

value="<?php echo($row["some_string_with_spaces"]);?>"

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Dec 03 01:00:01 2025 UTC