Forum Moderators: coopster
foreach ($_POST as $field => $value) {
$q .= $field."=".urlencode(htmlspecialchars($value, ENT_QUOTES))."&";
}
header("Location: new_member.php?error=".$errField."&".$q); die();
But when receiving the query string in the original form as:
<input id="fname" name="fname" maxlength="30" tabindex="1" value="<?=htmlspecialchars_decode(urldecode($_GET["fname"]), ENT_QUOTES)?>" /> die();
/Claes
If you do, now's the time to disable them [php.net] for good!
foreach ($_POST as $field => $value) {
$q .= $field."=".urlencode(stripslashes($value))."&";
}
header("Location: new_member.php?error=".$errField."&".$q); die();
<input... value="<?=stripslashes(urldecode($_GET['fname']))?>"/>
Thanks
/Claes
setting php_flag magic_quotes_gpc Off in htaccess
Not all servers support that method... You can make a quick phpinfo [php.net]() page in the same directory as your .htaccess rule and check to see if it is actually disabling magic quotes.
magic_quotes_gpc Off On
magic_quotes_runtime Off Off
I thought I then could skip the stripslashes() in the rePost function:
foreach ($_POST as $field => $value) {
$q .= $field."=".urlencode($value)."&";
}
header("Location: new_member.php?error=".$errField."&".$q);
and in the original form field (new_member.php):
<input... value="<?=urldecode($_GET["fname"])?>"/>
header("Location: new_member.php?error=".$errField."&".$q);