Jump to content

Somebody. Please help me with this contact form, ITS DRIVING ME CRAZY.


crj900

Recommended Posts

OK. I am not a programmer, i know very little about .php. I have used EVERY contact form generator on the internet it seems, nothing has worked. Could someone please tell me why this isnt working. The first quote is the .html file, and the 2nd one is the.php. The "contact.php" is replace with the correct URL when uploading.

 

<!-- Website Contact Form Generator -->

<!-- http://www.tele-pro.co.uk/scripts/contact_form/ -->

<!-- This script is free to use as long as you  -->

<!-- retain the credit link  -->

 

<form method="POST" action="contact.php">

Fields marked (*) are required

 

<p>Email From:* <br>

<input type="text" name="EmailFrom">

<p>FT:<br>

<input type="text" name="FT">

<p>pt:<br>

<input type="text" name="pt">

<p>summer:<br>

<input type="text" name="summer">

<p>transporters:<br>

<input type="text" name="transporters">

<p>overnights:<br>

<input type="text" name="overnights">

<p>swaddlingnewcare:<br>

<input type="text" name="swaddlingnewcare">

<p>nany:<br>

<input type="text" name="nany">

<p>temp:<br>

<input type="text" name="temp">

<p>parentsname:<br>

<input type="text" name="parentsname">

<p>address:<br>

<input type="text" name="address">

<p>livein:<br>

<input type="text" name="livein">

<p>cell:<br>

<input type="text" name="cell">

<p>homephone:<br>

<input type="text" name="homephone">

<p><input type="submit" name="submit" value="Submit">

</form>

<p>

 

<!-- Contact Form credit link -->

Created by <a target="_blank"

href="http://www.tele-pro.co.uk/scripts/contact_form/">Contact

Form Generator</a>

 

 

 

 

 

<?php

// Website Contact Form Generator

// http://www.tele-pro.co.uk/scripts/contact_form/

// This script is free to use as long as you 

// retain the credit link 

 

// get posted data into local variables

$EmailFrom = Trim(stripslashes($_POST['EmailFrom']));

$EmailTo = "chrisj900@hotmail.com";

$Subject = "Customer";

$FT = Trim(stripslashes($_POST['FT']));

$pt = Trim(stripslashes($_POST['pt']));

$summer = Trim(stripslashes($_POST['summer']));

$transporters = Trim(stripslashes($_POST['transporters']));

$overnights = Trim(stripslashes($_POST['overnights']));

$swaddlingnewcare = Trim(stripslashes($_POST['swaddlingnewcare']));

$nany = Trim(stripslashes($_POST['nany']));

$temp = Trim(stripslashes($_POST['temp']));

$parentsname = Trim(stripslashes($_POST['parentsname']));

$address = Trim(stripslashes($_POST['address']));

$livein = Trim(stripslashes($_POST['livein']));

$cell = Trim(stripslashes($_POST['cell']));

$homephone = Trim(stripslashes($_POST['homephone']));

 

// validation

$validationOK=true;

if (Trim($EmailFrom)=="") $validationOK=false;

if (!$validationOK) {

  print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";

  exit;

}

 

// prepare email body text

$Body = "";

$Body .= "FT: ";

$Body .= $FT;

$Body .= "\n";

$Body .= "pt: ";

$Body .= $pt;

$Body .= "\n";

$Body .= "summer: ";

$Body .= $summer;

$Body .= "\n";

$Body .= "transporters: ";

$Body .= $transporters;

$Body .= "\n";

$Body .= "overnights: ";

$Body .= $overnights;

$Body .= "\n";

$Body .= "swaddlingnewcare: ";

$Body .= $swaddlingnewcare;

$Body .= "\n";

$Body .= "nany: ";

$Body .= $nany;

$Body .= "\n";

$Body .= "temp: ";

$Body .= $temp;

$Body .= "\n";

$Body .= "parentsname: ";

$Body .= $parentsname;

$Body .= "\n";

$Body .= "address: ";

$Body .= $address;

$Body .= "\n";

$Body .= "livein: ";

$Body .= $livein;

$Body .= "\n";

$Body .= "cell: ";

$Body .= $cell;

$Body .= "\n";

$Body .= "homephone: ";

$Body .= $homephone;

$Body .= "\n";

 

// send email

$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");

 

// redirect to success page

if ($success){

  print "<meta http-equiv=\"refresh\" content=\"0;URL=ok.htm\">";

}

else{

  print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";

}

?>

Link to comment
Share on other sites

It wont send me back an email when the submit button is pressed.

 

Do you mean that:

 

a: nothing happens

b: the 'error' page loads

c: you do not receive the email

 

If c is the problem, what happens when you use a proper domain email address rather then a hotmail address as the receiving address, and what happens when you use a 'from' email address that corresponds to the domain where this form resides?

Link to comment
Share on other sites

Another thing, what's with all the open p tags in the HTML code? They need to be closed:

 

<p>Text here</p>

 

And the input tags should be closed within the opening tag, like this:

 

<input type="text" name="name" />

 

I'm not sure if this could have anything to do with the mail not arriving, but you should correct the code either way.

Link to comment
Share on other sites

Is it because your not actually sending the email you are just storing it in a variable

 

shouldn't it be:

 

mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");

 

instead of

 

$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");

 

~ Chocopi

Link to comment
Share on other sites

Could someone try that site out, and try to make their own contact form. I have no idea what I am doing wrong, I have put about 10 hours into this already. I changed the email address, and this still did not work. I changed to chris@chrisjenkinsinc.com, and the site im uploading it to is chrisjenkinsinc.com

 

Please help, I am willing to pay at this point via paypal.

 

Thanks.  :'(

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.