I created a site:
http://onesportsonline.com/ that I'm hosting on go daddy. This is my first mail form. The form works somewhat. I am able to recieve and email with the visitors name and email address and a comment. HOWEVER, in the message box you can not put a space between words. Also after hitting the submit button and error comes up. Any help would be appreciated with this.
Here's the 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"]."/");
}
?>
- <?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"]."/");
- }
- ?>
Here's the HTML associated with form:
<p>
<form action="/gdform.php" method="post">
<input type="hidden" name="subject" value="New E-Mail Subscriber" />
<input type="hidden" name="redirect" value="http://www.onesportsonline.com" />
<p>First Name <br/>
<input type="text" name="FirstName" /></p>
<p>Last Name<br/>
<input type="text" name="LastName" /></p>
<p>E-Mail<br/>
<input type="text" name="email" /></p>
<p>Message<br/>
<textarea name="comments" cols="50" rows="4">
</textarea></p>
<input type="submit" name="submit" value="submit"/>
</form></p>
- <p>
- <form action="/gdform.php" method="post">
- <input type="hidden" name="subject" value="New E-Mail Subscriber" />
- <input type="hidden" name="redirect" value="http://www.onesportsonline.com" />
- <p>First Name <br/>
- <input type="text" name="FirstName" /></p>
- <p>Last Name<br/>
- <input type="text" name="LastName" /></p>
- <p>E-Mail<br/>
- <input type="text" name="email" /></p>
- <p>Message<br/>
- <textarea name="comments" cols="50" rows="4">
- </textarea></p>
- <input type="submit" name="submit" value="submit"/>
- </form></p>
Created a Contact Us section