#19489 [Opn->Bgs]: using html entities
| From: | sniper@php.net | Date: | Thu, 19 Sep 2002 10:41:52 +0000 |
| Subject: | #19489 [Opn->Bgs]: using html entities | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-19733@lists.php.net to get a copy of this message | ||
ID: 19489
Updated by: sniper@php.net
Reported By: nando@aboutown.ca
-Status: Open
+Status: Bogus
Bug Type: Variables related
Operating System: red hat 7.2
PHP Version: 4.2.0
New Comment:
Sorry, but the bug system is not the appropriate forum for asking
support questions. 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
Thank you for your interest in PHP.
Previous Comments:
------------------------------------------------------------------------
[2002-09-19 00:39:53] nando@aboutown.ca
I am using PHP/MySQL for login to a system I'm writing.
Here's an enable of reading a record from MySQL and creating a table in
a web page...
if ($row=mysql_fetch_array($result,MYSQL_BOTH))
{
$old_name1 = $row["username"];
$old_ability1 = $row["ability"];
$old_comments1 = $row["comments"];
$old_password1 = $row["password"];
$old_created = $row["created"];
$old_modified = $row["modified"];
$user_id = $row["userid"];
$old_name =htmlentities($old_name1);
$old_password =htmlentities($old_password1);
$old_ability =htmlentities($old_ability1);
$old_comments =htmlentities($old_comments1);
echo"<TR height=15></TR>";
echo"<TR><TD align=right
valign=top><B>Username</B></TD><TD><input
type=text name=new_name size=30 value=$old_name></TD></TR>";
echo"<TR><TD align=right
valign=top><B>Password</B></TD><TD><input
type=password name=new_password size=30
value=$old_password></TD></TR>";
echo"<TR><TD align=right
valign=top><B>Ability</B></TD><TD><textarea
name=new_ability cols=80 rows=3>$old_ability</textarea></TD></TR>";
echo"<TR><TD align=right
valign=top><B>Created</B></TD><TD>$old_created</TD></TR>";
echo"<TR><TD align=right
valign=top><B>Modified</B></TD><TD>$old_modified</TD></TR>";
echo"<TR><TD align=right
valign=top><B>Comments</B></TD><TD><textarea name=new_comments cols=80
rows=15>$old_comments</textarea></TD></TR>";
echo"<TR height=15></TR>";
echo"<input type=hidden name=userid value=$user_id>";
echo"<input type=hidden name=old_name value=$old_name1>";
echo"<input type=hidden name=old_ability value=$old_ability1>";
echo"<input type=hidden name=old_created value=$old_created>";
echo"<input type=hidden name=old_modified value=$old_modified>";
//use these 2 hiddens to determine change since edit by someone else
and not save changes
echo"<input type=hidden name=userid value=$user_id>";
echo"<input type=hidden name=silly value=$old_comments>";
echo"<input type=hidden name=old_name value=$old_name>";
echo"<input type=hidden name='old_comments' value=$old_comments>";
echo"<input type=hidden name=old_password value=$old_password>";
To get HTMLENTITES to work propery, I found out I must
use HTMLENTITES and assign to a new variable. It I use
the same variable [as in $old_name=HTMLENTITIES($old_name)]
then PHP does not create the correct page.
When I use a different var on the left of the equal sign,
then it works.
Very wierd.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=19489&edit=1