Jump to content

Recommended Posts

i got this in a tutorial, i know that where its says myemail i have to type my actual email ;)...this script is not working, i click the submit button but it doesnt email me the info.  PLEASE HELP ME, i dont know a thing about php, could someone fix this script please? i dont know what some people mean by i forgot the "s.  Thank you for your help, i will be eternally grateful.  I need this for my company's web page.

<?php

 

/* subject and email variables */

 

  $emailSubject = 'Client Query!';

  $webMaster = 'myemail';

 

/* Gathering data variables */

 

  $emailField = $_POST['email'];

  $nameField = $_POST['name'];

  $p_numberField = $_POST['p_number'];

  $commentsField = $_POST['comments'];

 

  $body = <<<EOD

<br><hr><br>

Email: $emailField <br>

Name: $nameField <br>

Phone Number: $p_numberField <br>

Comments: $commentsField <br>

EOD;

 

  $headers = "From: $emailField \r\n";

  $headers .= "Content-type: text/html\r\n";

  $success = mail($webMaster, $emailSubject, $body, $headers);

 

/* Results rendered as HTML */

 

  $theResults = <<<EOD

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>untitled</title>

<style type="text/css">

<!--

body {

  background-image: url(background%20links.jpg);

}

.style1 {

  font-family: "copperplate Gothic Bold";

  color: #51473E;

  font-size: 36px;

}

-->

</style></head>

 

<body>

<p class="style1"> </p>

<p class="style1"> </p>

<p align="center" class="style1">Thank you for contacting us!</p>

<p align="center" class="style1"> your email will be answered within 24 hours</p>

</body>

</html>

EOD;

echo "$theResults";

?>

 

Link to comment
https://forums.phpfreaks.com/topic/164973-contact-form-help/
Share on other sites

You already have an existing thread for this, don't start another one. Continue in the existing thread - http://www.phpfreaks.com/forums/index.php/topic,259413.0.html

 

Posting multiple threads for the same thing is both against the forum rules and surprisingly will kill the amount of help you get, not increase it.

Link to comment
https://forums.phpfreaks.com/topic/164973-contact-form-help/#findComment-869902
Share on other sites

I've answered your question on your other topic, http://www.phpfreaks.com/forums/index.php/topic,259413.0.html.

 

Please refer to this topic to get the appropriate answer for your question, and take Mabismad's advice, please do not create duplicate topics, it will drastically decrease your amount of support.  :-X

Link to comment
https://forums.phpfreaks.com/topic/164973-contact-form-help/#findComment-872471
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.