Page 1 of 1

Form mail php processing script problem, trying to sent...

Posted: Mon Oct 29, 2007 11:59 am
by julioykaly
Hello Everyone:

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"]."/");
     }

?>
Ok, that is the script read when our clients click the submit button. What I want the server to do is to email back an email to the client who provided their email address back to them, without using "mailto:" html tags and such.

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">

Posted: Mon Oct 29, 2007 3:58 pm
by califdon