473,785 Members | 2,443 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

3 New Member
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@bellonlin e.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($_SERV ER['PHP_SELF']);
$file_path = $path['dirname'];
print "<h1>BELLon line 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_p ath/</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&#x 69;n@b&#x65;&#x 6c;&#x6c;&#x6f; n&#x6c;ine.&#x6 3;o.&#x75;&#x6b ;\">&#x67;&#x61 ;v&#x69;n@b&#x6 5;&#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_addre ss))
{
$error = "1";
$info_error .= $lang_noaddress . "<br>";
}

if (empty ($senders_citys tatezip))
{
$error = "1";
$info_error .= $lang_nocitysta tezip . "<br>";
}

if (empty ($senders_phone number))
{
$error = "1";
$info_error .= $lang_nophonenu mber . "<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_invalidem ail . "<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 = "abcdefghijklmn opqrstuvwxyz234 56789";
srand((double)m icrotime()*1000 000);
$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($m ail_message);
print "<form name=\"BELLonli ne_email\" method=\"post\" style=\"margin: 0;\" action=\"\">
<table border=\"0\" cellspacing=\"2 \" cellpadding=\"2 \">
<tr align=\"center\ "$title_ali gn\" valign=\"center \">
<td colspan=\"2\">< span style=\"$title_ css\">$lang_tit le</span></td>
</tr>
<tr align=\"left\" valign=\"top\">
<td colspan=\"2\">$ info_notice$inf o_error</td>
</tr>
<tr valign=\"left\" >
<td width=\"165\" align=\"right\" >$lang_name</td>
<td align=\"center\ "><input name=\"senders_ name\" type=\"text\" class=\"mailfor m_input\" id=\"senders_na me\" style=\"width: $input_width;\" value=\"$sender s_name\" maxlength=\"32\ "></td>
</tr>
<tr valign=\"left\" >
<td width=\"165\" align=\"right\" >$lang_addres s</td>
<td align=\"center\ "><input name=\"senders_ address\" type=\"text\" class=\"mailfor m_input\" id=\"senders_na me\" style=\"width: $input_width;\" value=\"$sender s_address\" maxlength=\"32\ "></td>
</tr>
<tr valign=\"left\" >
<td width=\"165\" align=\"right\" >$lang_citystat ezip</td>
<td align=\"center\ "><input name=\"senders_ citystatezip\" type=\"text\" class=\"mailfor m_input\" id=\"senders_ad dress\" style=\"width: $input_width;\" value=\"$sender s_citystatezip\ " maxlength=\"32\ "></td>
</tr>
<tr valign=\"left\" >
<td width=\"165\" align=\"right\" >$lang_phonenum ber</td>
<td align=\"center\ "><input name=\"senders_ phonenumber\" type=\"text\" class=\"mailfor m_input\" id=\"senders_ph onenumber\" style=\"width: $input_width;\" value=\"$sender s_phonenumber\" maxlength=\"32\ "></td>
</tr>
<tr valign=\"left\" >
<td width=\"165\" align=\"right\" >$lang_youremai l</td>
<td align=\"center\ "><input name=\"senders_ email\" type=\"text\" class=\"mailfor m_input\" id=\"senders_em ail\" style=\"width: $input_width;\" value=\"$sender s_email\" maxlength=\"64\ "></td>
</tr>
<tr valign=\"left\" >
<td width=\"165\" align=\"right\" >$lang_subjec t</td>
<td align=\"center\ "><input name=\"mail_sub ject\" type=\"text\" class=\"mailfor m_input\" id=\"mail_subje ct\" style=\"width: $input_width;\" value=\"$mail_s ubject\" maxlength=\"64\ "></td>
</tr>
<tr valign=\"left\" >
<td width=\"165\" align=\"right\" >$lang_messag e</td>
<td align=\"center\ "><textarea name=\"mail_mes sage\" cols=\"36\" rows=\"5\" style=\"width: $input_width;\" class=\"mailfor m_input\">$mail _message</textarea></td>
</tr>
<tr align=\"left\" valign=\"right\ ">
<td width=\"165\">$ lang_confirmati on</td>
<td><input name=\"security _code\" type=\"text\" id=\"security_c ode\" size=\"5\">
&nbsp;&nbsp;&nb sp;&nbsp;<b>$ra ndom_code</b></td>
</tr>
<tr valign=\"top\">
<td colspan=\"2\" align=\"center\ "><input name=\"randomne ss\" type=\"hidden\" id=\"randomness \" value=\"$random _code\">
<input name=\"submit\" type=\"submit\" id=\"submit\" value=\"$lang_s ubmit\" class=\"mailfor m_button\"></td>
</tr>
</table>
</form>";
}
else
{



if ($checkdomain == "yes")
{
$sender_domain = substr($senders _email, (strpos($sender s_email, '@')) +1);
$recipient_doma in = substr($sendto_ email, (strpos($sendto _email, '@')) +1);
if ($sender_domain == $recipient_doma in)
{
print "Sorry, you cannot send messages from this domain ($sender_domain )";
exit;
}
}

$info_notice = $lang_sent;
$mail_message = stripslashes($m ail_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_em ail,"$mail_subj ect", $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_tit le</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_nam e</b></td>
</tr>
<tr valign=\"top\">
<td width=\"165\" align=\"right\" >$lang_addres s</td>
<td align=\"left\"> <b>$senders_add ress</b></td>
</tr>
<tr valign=\"top\">
<td width=\"165\" align=\"right\" >$lang_citystat ezip</td>
<td align=\"left\"> <b>$senders_cit ystatezip</b></td>
</tr>
<tr valign=\"top\">
<td width=\"165\" align=\"right\" >$lang_phonenum ber</td>
<td align=\"left\"> <b>$senders_pho nenumber</b></td>
</tr>
<tr valign=\"top\">
<td width=\"165\" align=\"right\" >$lang_youremai l</td>
<td align=\"left\"> <b>$senders_ema il</b></td>
</tr>
<tr valign=\"top\">
<td width=\"165\" align=\"right\" >$lang_subjec t</td>
<td align=\"left\"> <b>$mail_subjec t</b></td>
</tr>
<tr valign=\"top\">
<td width=\"165\" align=\"right\" >$lang_messag e</td>
<td align=\"left\"> <b>$mail_messag e</b></td>
</tr>
</table>";
}[/php]
Feb 10 '07 #1
6 1940
ronverdonk
4,258 Recognized Expert Specialist
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
4,258 Recognized Expert Specialist
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
5,058 Recognized Expert Expert
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
4,258 Recognized Expert Specialist
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
cfish
3 New Member
***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
202 New Member
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

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

Similar topics

3
6703
by: Corey | last post by:
Hello, I have created a form that is sent via email and am getting the following error: Warning: mail() expects at most 5 parameters, 14 given in /home/sites/site324/web/order_form_test1.php on line 277 What does this mean and how do I solve it?
0
1449
by: code_worthy | last post by:
I am trying to strip some data out of numerous emails and place it in my database. I know that this seems as if it has been done before. But, this is a little different. First, the numerous emails all have a set of data that needs to be extracted and inserted into the database. Some of the data in the email is id, name, address, city, state, zip, company, etc. The catch is that the date is formated and presented differently in each...
6
1403
by: Rani | last post by:
hi guys I need to send an email from a form the form is collecting data from a user and then submits it to us. I would like the email to appear in the following format Name: Email: Etc. all I was able to do so far is: strBody = "Name :" & strname & " Email :" & StrEmail etc.
8
3879
by: stirrell | last post by:
Hello, One problem that I had been having is stopping email injections on contact forms. I did some research, read up on it and felt like I had created a working solution. I hadn't gotten any suspicious bouncebacks in quite some time and got many custom alerts I had set up for notifying me of injection attempts. However, just the other day, I got a bounceback from an AOL address which leads me to believe that an injection attempt was...
9
2208
by: Jerim79 | last post by:
I am no PHP programmer. At my current job I made it known that I was no PHP programmer during the interview. Still they have given me a script to write with the understanding that it will take me a while (This information is just for general knowledge as I don't want anyone thinking I am trying to be dishonest with my intentions. Also, I do not portray myself as something I am not. I am a beginner.) Anyway, what the script needs to do is...
2
1605
by: Terry Olsen | last post by:
I have a very interesting request. A customer receives orders via email. The email contains the shipping address, shipping method, email address and phone number. This information is not all together, nor is it in the same format in each email as the emails come from different order houses. The customer wants me to scan the email and pull the information out so that it can be used to import into their shipping software. I've been able...
2
2317
by: sindhudixit | last post by:
Hey, I am having a user fill out a form then the fields are going to uploaded to my database. So, at this point, when the user hits the submit button I want three things to happen: 1. The form uploads to a database (the following code does this) 2. An e-mail is sent to my sales team as well as the customer, which contains the form values . 3. I want the user to then be directed automatically to another webpage, after they hit the...
0
2041
by: gervo | last post by:
I have built a series of email forms in flash MX. using perl. the forms work for some people but not all and I was hoping some one could help me out. Here is the Actionscript on the send button on (release, keyPress "<Enter>") { if (company ne "" and first ne "" and last ne "" and phone ne "" and fax ne "" and mobile ne "" and email ne "" and address ne "" and city ne "" and state ne "" and zip ne "") { i = "0"; validmail = 0;...
8
2918
by: nargis2009 | last post by:
Hi, I have been encountering problems with my web page which is supposed to send email, and wondered if anybody can help find error. Initially I had all codes in one page and on click of Submit it would send email. But then I wanted to give a user an opportunity to go back and edit the entries if incorrect before submitting. I separted the codes into two pages. On the second page when Submit button is clicked it should send email. But...
0
9489
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10357
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10162
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10101
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9959
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6744
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5396
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.