Jump to content

mj1224

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Everything posted by mj1224

  1. Thanks for your help. I replced my code with what you wrote and I don't get teh parse error. i get you didn't enter a valid email - even though i did when I tried it.
  2. I copied the code from another php helper website and just pasted it in. I added a closing bracket qand it still doesn't work. What difference does indenting make? i don't know php, I'm sorry. just trying to make a simple form be emailed from our website.
  3. no space or blank line.
  4. Here is the html for my form: <form name="gsginfo" method="post" action="contact.php"> <h3>Would you like more information?</h3> <p> Name: <input name="name" type="text" id="name" size="40" maxlength="40"> <span class="style3">*</span></p> <p>Address: <input name="address" type="text" id="address" size="60" maxlength="60"> </p> <p>City: <input name="city" type="text" id="city" size="25" maxlength="25"> </p> <p>State: <input name="state" type="text" id="state" size="2" maxlength="2"> </p> <p>Zip: <input name="zip" type="text" id="zip" size="10" maxlength="10"> </p> <p>Phone: <input name="phone" type="text" id="phone" size="15" maxlength="15"> <span class="style3">*<span class="style2">In case we have problems with your email.</span></span></p> <p>Email: <input name="email" type="text" id="email" size="30" maxlength="30"> <span class="style3">*</span></p> <p>Questions/Comments: <textarea name="comments" id="comments" cols="45" rows="5"></textarea> </p> <p> </p> <p> <input name="submit" type="submit" id="submit"> </p> </form> and here is my php: <?php $to = "tadams@forestry.state.sc.us"; $from = $_REQUEST['email'] ; $name = $_REQUEST['name'] ; $header = "From: $from"; $subject = "Grow Some Green" ; $fields = array(); $fields{"name"} = "Name"; $fields{"address"} = "Address"; $fields{"city"} = "City"; $fields{"state"} = "State"; $fields{"zip"} = "Zip"; $fields{"phone"} = "Phone"; $fields{"email"} = "Email"; $fields{"comments"} = "Comments-Questions"; $body = "We have received the following information:"; foreach($fields as $a => $b){ $body .= sprintf("%20s: %s\n",$b,$_REQUEST[$a]); } $autoreply = "Thank you for your interest in Grow Some Green. Someone will contact you shortly. If you have any more questions, please consult our website at www.growsomegreen.com"; if($email == '') {print "You have not entered an email, please go back and try again";} else { if($name == '') {print "You have not entered a name, please go back and try again";} else { if($phone == '') {print "You have not entered a phone number to get in touch with you in case we have problems replying to your email, please go back and try again";} else { $send = mail($to, $subject, $body, $header); if($send) {header( "Location: http://www.state.sc.us/forest/thankyou.htm" );} else {print "We encountered an error sending your mail, please notify webmaster@YourCompany.com"; } ?> What did I do wrong? Any help or suggestions wold be welcomed. I don't know php.
  5. I am not a php person, and I get a pase error : Parse error: parse error in www.mywebsite/contact.php on line 35 Line 35 is the last line of that file. I copied script from a code helper and loaded it but get that error when I fill in my form to submit it by email. What did I do wrong?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.