Jump to content


Photo

E-mail form downloading php file on submit rather than running script


  • Please log in to reply
4 replies to this topic

#1 kacieh80

kacieh80
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 21 September 2006 - 02:49 AM

hi, I am new to php, very new, i found a script and tweaked it for my liking on this page

windsor.txkweb.com/contact.html

works great, i took the same script only i took out all references to the phone, and i took the same form without the phone part and put it up on this site (in the bottom right hand corner)

www.literacycouncil.info

and when you submit on this one, it prompts to download the script rather than running the script

could it be my error...i can't see where i am wrong because its exactly the same as the other site accept the phone stuff, or could it be that the ftp site is just not set up for php, if so how do i set it up for php?

please help

#2 shelbyshop

shelbyshop
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 21 September 2006 - 02:59 AM

Please post the code you used to put that on your site

#3 kacieh80

kacieh80
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 21 September 2006 - 03:02 AM

<?php
if(isset($_POST['submit'])) {
$to = "supersssweety@yahoo.com";
$subject = "Website Form Contact";
$name_field = $_POST['name'];
$email_field = $_POST['email'];
$message = $_POST['message'];
 
$body = "From: $name_field\n E-Mail: $email_field\n Message:\n $message";
 

mail($to, $subject, $body);
} else {
echo "There has been a problem in processing your request";
}

?>

<html>
<head>
<META HTTP-EQUIV="Refresh" CONTENT="0;URL=thankyou.html">
</head>
</html>

this is the one that won't work

#4 shelbyshop

shelbyshop
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 21 September 2006 - 03:04 AM

Place the html code to please

#5 kacieh80

kacieh80
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 21 September 2006 - 03:09 AM

haha sorry...here is the form return validate() is java script at the top...its on both sites, and it works on this one, just the php won't work for the literacy council...don't you have to set the server up to run php? I can't get into any of those files, I emailed the guy that runs the server, but again, it may not be that 

<form method="POST" name= "form" action="mailer.php" onSubmit="return validate()">
                  <h6 align="left">Name:</h6>
                  &nbsp;&nbsp;<input type="text" name="name" size="12">
                  <h6 align="left">E-mail:</h6>           
                  &nbsp;&nbsp;<input type="text" name="email" size="12">
                  <h6 align="left">Message:</h6>
                  &nbsp;&nbsp;<textarea rows="4" name="message" cols="12"></textarea>
                  <br>
                  <br>
                  &nbsp;&nbsp;<input type="submit" value="Submit" name="submit">                         
                </form> 




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users