displaying html form data in php
Posted: Tue Oct 23, 2007 7:21 am
feyd | Please use
Is is possible to get the entire field to completely display in the php form?
Regards,
Charlie
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I've read (a lot) in the PHP manual and can't see why/how this occurs. I know that php variables can't contain spaces, if I read the manual correctly.
I have an .html file that passes form data (with spaces in the html form field), to a .php file that also has a form, but I can get only the first piece of data ("x") displayed in the php form.
Here's what I have:Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Language" content="en-us">
</head>
<body>
<?
// DEBUG
$fname = $_POST['fname'];
echo "fname: ".$fname."<BR><BR>";
$len=strlen($fname);
echo " len: ".$len;
// value of $fname is displayed as x x and the value of strlen($fname) is displayed as 3
//END DEBUG
?>
<form id="newdata" name="newdata" method="post" action="xxxx.cfm?sid=AF065">
<input type="text" name="fname" value= <? echo $fname ?>>
<input type="text" name="fname2" value=<? echo $_POST['fname'] ?>>
</form>
</body>
</html>Regards,
Charlie
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]