I have a problem with a form mail that I created for a web site I am working on and the problem I have is processing the information with the generated php script:
Code: Select all
<?php
$request_method = $_SERVER["REQUEST_METHOD"];
if($request_method == "GET")
{
$query_vars = $_GET;
}
elseif ($request_method == "POST")
{
$query_vars = $_POST;
}
reset($query_vars);
$t = date("U");
$file = $_SERVER['DOCUMENT_ROOT'] . "/../data/gdform_" . $t;
$fp = fopen($file,"w");
while (list ($key, $val) = each ($query_vars))
{
fputs($fp,"<GDFORM_VARIABLE NAME=$key START>\n");
fputs($fp,"$val\n");
fputs($fp,"<GDFORM_VARIABLE NAME=$key END>\n");
if ($key == "redirect")
{
$landing_page = $val;
}
}
fclose($fp);
if ($landing_page != "")
{
header("Location: http://".$_SERVER["HTTP_HOST"]."/$landing_page");
}
else
{
header("Location: http://".$_SERVER["HTTP_HOST"]."/");
}
?>Code: Select all
<form action="gdform.php" method="post" name=submitform>
</form>Code: Select all
<input type="text" name="name" size="50" maxlength="50">
<input type="text" name="category" size="50" maxlength="50">
<input type="text" name="address" size="50" maxlength="50">
<input type="text" name="zipcode" size="28" maxlength="50">
<input type="text" name="telephone" size="28" maxlength="50">
<input type="text" name="email" size="28" maxlength="50">
<input type="text" name="website" size="28" maxlength="50">Code: Select all
<input type="submit" value="Sent E-Mail" redirect="gracias.htm">
<input type="reset" value="Clear">