[thelist] Feedback form [PHP]

Bill Haenel mail at webmarketingworx.com
Fri Jan 17 09:09:31 CST 2003


I think this part of the code may be the problem, depending on what
you've got for data in those fields:

> foreach($_POST as $key => $value) echo "<input type =
> 'hidden' name = ".$key." value = ".$value.">\n";


If a field name of 'test' has a value of say, 'My name is
bwackensquork', the HTML that would be outputted by the code above might
be something like:

<input type = 'hidden' name = test value = My name is bwackensquork>

The quotes on the attribute values are missing, so the value passed
through contains only the first word. Try putting single quotes like so:

foreach($_POST as $key => $value) echo "<input type =
'hidden' name = '".$key."' value = '".$value."'>\n";

Or better yet, maybe try this on:

<?
foreach($_POST as $key => $value) {?>
<input type="hidden" name="<?=$key?>" value="<?=$value?>">
<?}?>

BH




More information about the thelist mailing list