I am on a GoDaddy hosted site trying to process a form.
First off, the gdform.php:
<?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"]."/");
}
?>
Looks to me like a recursive function that spits out all data in no particular order.
My variables:
"Name" - Type: Text
"City" - Type: Text
"Email" - Type: Text
etc...
Instrumentalist - Type: Checkbox - Returns "on" if checked
Vocalist - Type: Checkbox - Returns "on" if checked
etc...
What I want is to be able to receive an email that says:
Hello, you have received a response from your web form!
Bob Smith of Jonesville is a
- Vocalist
- Instrumentalist
- Harmonist
...
I assume that this will be accomplished through if and echo statements like:
echo $Name; echo " of "; echo $City; echo " is a<br>"
if $vocalist == "on" then echo " - Vocalist<br>"
...
Am I on the right track? All attempts thus far have failed. Once I get down the right path, I'm sure that I can find the rest of the way. Thanks so much, experts!