tstout2 Posted September 13, 2008 Share Posted September 13, 2008 Hey everyone! I am completely new to websites and to PHP, so go easy on me. I purchased a Flash template website and it came with a form mailer PHP file. My hosting site (GoDaddy.com) requires you to use their PHP code. I need help integrating the two so that my form mailer on my website works. Thanks in advance for any help you guys can give! Code from Flash template---- <? $name=$_POST['name']; $email=$_POST['email']; $phone=$_POST['phone']; $message=$_POST['message']; $ToEmail = "email@domain.com"; $ToSubject = "Message from Domain"; $EmailBody = "Name: $name\n Email: $email\n Phone: $phone\n Message: $message\n"; $Message = $EmailBody; $headers .= "Content-type: text; charset=iso-8859-1\r\n"; $headers .= "From:".$name." / ".$email."\r\n"; mail($ToEmail,$ToSubject,$Message, $headers); ?> Code from GoDaddy.com---- <?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'] . "\ssfm\gdform_" . $t; $fp = fopen($file,"w"); while (list ($key, $val) = each ($query_vars)) { fputs($fp,"<GDFORM_VARIABLE NAME=$key START>\r\n"); fputs($fp,"$val\r\n"); fputs($fp,"<GDFORM_VARIABLE NAME=$key END>\r\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"]."/"); } ?> Quote Link to comment Share on other sites More sharing options...
tstout2 Posted September 17, 2008 Author Share Posted September 17, 2008 Is there someone who can help me? tstout2 Quote Link to comment Share on other sites More sharing options...
M.O.S. Studios Posted September 17, 2008 Share Posted September 17, 2008 it dosn't make scence that go daddy would require you to use their script i think your problem is here $name=$_POST['name']; $email=$_POST['email']; $phone=$_POST['phone']; $message=$_POST['message']; $ToEmail = "email@domain.com"; $ToSubject = "Message from Domain"; by the looks of it this form is so people can send you an email so first change 1. $ToEmail = "email@domain.com"; so that email@domain.com is your email; 2. $ToSubject = "Message from Domain"; so that Message from Domain is the subject you want the email to be. next lookup how to use a form with flash. make the method = "POST" (all in caps) and the action the name of the script with extention and path so if its in the same dir and its called script.php it would be action = "script.php" if it is in one directory up called path then it would be path/script.php im guessing your template has a form already, it should be easy how to set the form. Quote Link to comment Share on other sites More sharing options...
tstout2 Posted September 17, 2008 Author Share Posted September 17, 2008 First off, I changed the true values of "email@domain.com" and "Message from Domain" for this posting. Of course my template already has a form for this, and that is the code I pasted in my original message. The code from the template is from a file called mail.php and the code from godaddy is gd_form.php. So how to I use these together? tstout2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.