GSM Handsets
please help me with this php script!?
<?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";
?>
EDIT:
The script is generating nothing right?
in your EOD statements you have failed to add ‘ quotations. An example:
$str = <<<’EOD’ <– notice the ‘ before and after EOD
Example of string
spanning multiple lines
using nowdoc syntax.
EOD;
This came straight from PHP help documentation.
http://ca.php.net/manual/en/language.types.string.php
2 Responses to “please help me with this php script!?”
Leave a Reply
August 1st, 2009
Posted by admin in imaging center phone number | 2 Comments »
EDIT:
The script is generating nothing right?
in your EOD statements you have failed to add ‘ quotations. An example:
$str = <<<’EOD’ <– notice the ‘ before and after EOD
Example of string
spanning multiple lines
using nowdoc syntax.
EOD;
This came straight from PHP help documentation.
http://ca.php.net/manual/en/language.types.string.php
References :
i add ‘ end of ,myemail. use the below script and its working fine, but it throws notice errors,
<?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";
?>
References :