I need to get the POST array value snail_1 from the following code when it’s passed to page_2.php.
This works ok for me:-
Code: Select all
<form action="page_2.php" method="post" name="form1" id="form1">
input type="text" name="subject" value="" size="32" />
<input type="hidden" name="mail_1" value="sail_1" />
</form>However I’m aware that using <form action="page_2.php" is not recommended (and not too sure why just yet but know it’s a security issue) so I have been trying to use something like this:
<form action="<?php echo $editFormAction; ?>"
Code: Select all
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
$insertGoTo = "page_2.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));Any pointers would be great
Thanks