By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,817 Members | 1,436 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,817 IT Pros & Developers. It's quick & easy.

Email will not output Address, City, State, Zip & phone number

P: 3
I'm trying to script my contact page and I have everything the way I want it however I cannot get my script to output Address, City, State, Zip & Phone Number when I get a email. It will output email address, subject & message.
Please help![php]
/*
BELLonline PHP MAILER SCRIPT v1.4
Copyright 2006 Gavin Bell
http://www.bellonline.co.uk
gavin@bellonline.co.uk

modified by Craig Fisher for Dakota Portraits - 1-30-2006
*/

extract($_POST);

if (!file_exists("config.php"))
{
$host = $_SERVER[HTTP_HOST ];
$path = pathinfo($_SERVER['PHP_SELF']);
$file_path = $path['dirname'];
print "<h1>BELLonline PHP mailer script</h1>
<h2>There is a problem with your PHP mailer script installation</h2>
<p>The config.php file seems to be missing!</p>
<p>For this script to work, you need to upload the config.php file that came with the download of the BELLonline <a href=\"http://www.bellonline.co.uk/web-services/free/scripts/php-mailer-script/\">PHP mailer script</a>.</p>
<p>The file must be in the following directory of your website:</p>
<p>$host<span style=\"font-weight: bold; font-size: 150%;\">$file_path/</span></p>
<p>If you need help installing the script, then feel free to email me at <a href=\"&#x6d;&#x61;ilt&#x6f;:&#x67;&#x61;v&#x69;n@ b&#x65;&#x6c;&#x6c;&#x6f;n&#x6c;ine.&#x63;o.&#x75; &#x6b;\">&#x67;&#x61;v&#x69;n@b&#x65;&#x6c;&#x6c;& #x6f;n&#x6c;ine.&#x63;o.&#x75;&#x6b;</a></p>";
exit;
}
include "config.php";



if (empty ($senders_name))
{
$error = "1";
$info_error .= $lang_noname . "<br>";
}

if (empty ($senders_address))
{
$error = "1";
$info_error .= $lang_noaddress . "<br>";
}

if (empty ($senders_citystatezip))
{
$error = "1";
$info_error .= $lang_nocitystatezip . "<br>";
}

if (empty ($senders_phonenumber))
{
$error = "1";
$info_error .= $lang_nophonenumber . "<br>";
}

if (empty ($senders_email))
{
$error = "1";
$info_error .= $lang_noemail . "<br>";
}

if (empty ($mail_subject))
{
$error = "1";
$info_error .= $lang_nosubject . "<br>";
}

if (empty ($mail_message))
{
$error = "1";
$info_error .= $lang_nomessage . "<br>";
}

if (!eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,6}$", $senders_email))
{
$error = "1";
$info_error .= $lang_invalidemail . "<br>";
}

if (empty ($security_code))
{
$error = "1";
$info_error .= $lang_nocode . "<br>";
}

elseif ($security_code != $randomness)
{
$error = "1";
$info_error .= $lang_wrongcode . "<br>";
}

if ($error == "1")
{
$info_notice = "<span style=\"color: " . $error_colour . "; font-weight: bold;\">" . $lang_error . "</span><br>";


if (empty ($submit))
{
$info_error = "";
$info_notice = $lang_notice;
}

function Random()
{
$chars = "abcdefghijklmnopqrstuvwxyz23456789";
srand((double)microtime()*1000000);
$i = 0;
$pass = '' ;
while ($i <= 4)
{
$num = rand() % 32;
$tmp = substr($chars, $num, 1);
$pass = $pass . $tmp;
$i++;
}
return $pass;
}
$random_code = Random();
$mail_message = stripslashes($mail_message);
print "<form name=\"BELLonline_email\" method=\"post\" style=\"margin: 0;\" action=\"\">
<table border=\"0\" cellspacing=\"2\" cellpadding=\"2\">
<tr align=\"center\"$title_align\" valign=\"center\">
<td colspan=\"2\"><span style=\"$title_css\">$lang_title</span></td>
</tr>
<tr align=\"left\" valign=\"top\">
<td colspan=\"2\">$info_notice$info_error</td>
</tr>
<tr valign=\"left\">
<td width=\"165\" align=\"right\">$lang_name</td>
<td align=\"center\"><input name=\"senders_name\" type=\"text\" class=\"mailform_input\" id=\"senders_name\" style=\"width: $input_width;\" value=\"$senders_name\" maxlength=\"32\"></td>
</tr>
<tr valign=\"left\">
<td width=\"165\" align=\"right\">$lang_address</td>
<td align=\"center\"><input name=\"senders_address\" type=\"text\" class=\"mailform_input\" id=\"senders_name\" style=\"width: $input_width;\" value=\"$senders_address\" maxlength=\"32\"></td>
</tr>
<tr valign=\"left\">
<td width=\"165\" align=\"right\">$lang_citystatezip</td>
<td align=\"center\"><input name=\"senders_citystatezip\" type=\"text\" class=\"mailform_input\" id=\"senders_address\" style=\"width: $input_width;\" value=\"$senders_citystatezip\" maxlength=\"32\"></td>
</tr>
<tr valign=\"left\">
<td width=\"165\" align=\"right\">$lang_phonenumber</td>
<td align=\"center\"><input name=\"senders_phonenumber\" type=\"text\" class=\"mailform_input\" id=\"senders_phonenumber\" style=\"width: $input_width;\" value=\"$senders_phonenumber\" maxlength=\"32\"></td>
</tr>
<tr valign=\"left\">
<td width=\"165\" align=\"right\">$lang_youremail</td>
<td align=\"center\"><input name=\"senders_email\" type=\"text\" class=\"mailform_input\" id=\"senders_email\" style=\"width: $input_width;\" value=\"$senders_email\" maxlength=\"64\"></td>
</tr>
<tr valign=\"left\">
<td width=\"165\" align=\"right\">$lang_subject</td>
<td align=\"center\"><input name=\"mail_subject\" type=\"text\" class=\"mailform_input\" id=\"mail_subject\" style=\"width: $input_width;\" value=\"$mail_subject\" maxlength=\"64\"></td>
</tr>
<tr valign=\"left\">
<td width=\"165\" align=\"right\">$lang_message</td>
<td align=\"center\"><textarea name=\"mail_message\" cols=\"36\" rows=\"5\" style=\"width: $input_width;\" class=\"mailform_input\">$mail_message</textarea></td>
</tr>
<tr align=\"left\" valign=\"right\">
<td width=\"165\">$lang_confirmation</td>
<td><input name=\"security_code\" type=\"text\" id=\"security_code\" size=\"5\">
&nbsp;&nbsp;&nbsp;&nbsp;<b>$random_code</b></td>
</tr>
<tr valign=\"top\">
<td colspan=\"2\" align=\"center\"><input name=\"randomness\" type=\"hidden\" id=\"randomness\" value=\"$random_code\">
<input name=\"submit\" type=\"submit\" id=\"submit\" value=\"$lang_submit\" class=\"mailform_button\"></td>
</tr>
</table>
</form>";
}
else
{



if ($checkdomain == "yes")
{
$sender_domain = substr($senders_email, (strpos($senders_email, '@')) +1);
$recipient_domain = substr($sendto_email, (strpos($sendto_email, '@')) +1);
if ($sender_domain == $recipient_domain)
{
print "Sorry, you cannot send messages from this domain ($sender_domain)";
exit;
}
}

$info_notice = $lang_sent;
$mail_message = stripslashes($mail_message);
$senders_email = preg_replace("/[^a-zA-Z0-9s.@-]/", " ", $senders_email);
$senders_name = preg_replace("/[^a-zA-Z0-9s]/", " ", $senders_name);
$headers = "From: $senders_name <$senders_email> - Dakota Portraits email submission\r\n";
$headers .= "Reply-to: $senders_email\n";
$headers .= "X-Mailer: Dakota Portraits website email submission form\r\n";
$headers .= "Content-Type: text/plain; charset=iso-8859-1\n";
mail($sendto_email,"$mail_subject", $mail_message, $headers);
print " <table border=\"0\" cellspacing=\"2\" cellpadding=\"2\">
<tr align=\"$title_align\" valign=\"center\">
<td colspan=\"2\"><span style=\"$title_css\">$lang_title</span></td>
</tr>
<tr align=\"$title_align\" valign=\"top\">
<td colspan=\"2\">$info_notice</td>
</tr>
<tr valign=\"top\">
<td width=\"165\" align=\"right\">$lang_name</td>
<td align=\"left\"><b>$senders_name</b></td>
</tr>
<tr valign=\"top\">
<td width=\"165\" align=\"right\">$lang_address</td>
<td align=\"left\"><b>$senders_address</b></td>
</tr>
<tr valign=\"top\">
<td width=\"165\" align=\"right\">$lang_citystatezip</td>
<td align=\"left\"><b>$senders_citystatezip</b></td>
</tr>
<tr valign=\"top\">
<td width=\"165\" align=\"right\">$lang_phonenumber</td>
<td align=\"left\"><b>$senders_phonenumber</b></td>
</tr>
<tr valign=\"top\">
<td width=\"165\" align=\"right\">$lang_youremail</td>
<td align=\"left\"><b>$senders_email</b></td>
</tr>
<tr valign=\"top\">
<td width=\"165\" align=\"right\">$lang_subject</td>
<td align=\"left\"><b>$mail_subject</b></td>
</tr>
<tr valign=\"top\">
<td width=\"165\" align=\"right\">$lang_message</td>
<td align=\"left\"><b>$mail_message</b></td>
</tr>
</table>";
}[/php]
Feb 10 '07 #1
Share this Question
Share on Google+
6 Replies


ronverdonk
Expert 2.5K+
P: 4,258
Before you post any further in this forum, read the Posting Guidelines, especially the part about enclosing your code within code or php tags!!!
You are breaking the box with the way you show it now.

Moderator
Feb 10 '07 #2

ronverdonk
Expert 2.5K+
P: 4,258
Welcome to The Scripts.

Before you post any further in this forum, read the Posting Guidelines, especially the part about enclosing your code within code or php tags!!!
You are breaking the box with the way you show it now.

Moderator
Feb 10 '07 #3

Atli
Expert 5K+
P: 5,058
I cant see the problem :/
Except that you mixed up some of the text fields id's, but I doubt that will cause a problem.
Feb 10 '07 #4

ronverdonk
Expert 2.5K+
P: 4,258
I removed you post because it is identical to the original post. And you are still NOT enclosing it within the required tags, thereby breaking this box.

moderator
Feb 11 '07 #5

P: 3
***Bump***

My apologize for not using the correct tags!

Does anyone see an issue with this script as far as why it will not output the address, city, state, zip & phone number in the email that it sends? If you need more info please let me know.
Feb 12 '07 #6

cassbiz
100+
P: 202
Just by looking at the script, perhaps I am wrong here, but I don't see where the $lang* is associated with your $headers.
Feb 12 '07 #7

Post your reply

Sign in to post your reply or Sign up for a free account.