Hi!
INFO ON SYSTEM: Register_globals is off, using PHP 4.3.0, IIS, Win2K
ISSUE: Variable grabs full db field string on page 1, but after post, if the variable db field value is 2 words, the 'space' and the last word are cut off; value has been truncated to the first word only.
EX: If value from db is "White Sedan", it displays properly on page 1, and a var_dump shows that the variable does, too -- but after passing it thru a hiden field to post to page 2, only "White" appears on the second page
sub1.php
connect to db, then
$sql ="SELECT car_ID, car_name from cars";
$result = mysql_query($sql);
$MyArray = mysql_fetch_assoc($result);
?>
<FORM METHOD="POST" ACTION="sub2.php">
<?
while ($MyArray = mysql_fetch_assoc($result)) {
$car= $MyArray["car_name"];
echo "<input type=\"text\" name=rec size=2>";
echo $car;
echo "<BR>"; ?>
<input type="hidden" name="carname" value=<?=$car?>>
<?
}
?>
<input type="Submit" name"Subthis" value="CalcRec">
</FORM>
sub2.php
<HTML>
<HEAD><TITLE>Post from sub1</TITLE>
<BODY>
User Input was <?php echo $POST["rec"]; ?>.
Value from db was <?php echo $POST["carname"];?>
</BODY>
</HTML>
Any help much appreciated! PHP is GREAT.
SIDE NOTE FOR ANY PRO PHP PERSON INTERESTED IN HELPING ON THIS PROJECT: User textbox displays properly and takes input. I've I've not yet learned how to post an array to page 2, so I'm only displaying the last row of the array there.) I still have to figure out how to attach the multiple textboxes to the db rows, and pass only the 'filled in' textbox values along with the associated db info, to page 2.
Many thanks -
StratGuitar