<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1040184" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1040184</link>
    <description></description>
    <language>en</language>
          <item>
    <title>resolved</title>
    <link>https://www.webmaster-forums.net/server-side-scripting/need-else-if-statement-php-script#comment-1226639</link>
    <description> &lt;p&gt;A buddy of mine from Indiana resolved this issue in about ten minutes. In case anyone&#039;s interested, the below code works perfectly.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;$tomail &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;friend_1\&quot;];&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$from&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;sender_email\&quot;];&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$copyfrom&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;sender_email\&quot;];&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$notifyMail&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = \&quot;contact@mywebsite.com\&quot;;&lt;br /&gt;&lt;br /&gt;// Check the email address&lt;br /&gt;if(!preg_match(&#039;/^[^@\s&amp;lt;&amp;amp;&amp;gt;]+@([-a-z0-9]+\.)+[a-z]{2,}$/i&#039;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$from&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;)) {&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$errormessage&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = \&quot;Your e-mail address is invalid!\&quot;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if(!preg_match(&#039;/^[^@\s&amp;lt;&amp;amp;&amp;gt;]+@([-a-z0-9]+\.)+[a-z]{2,}$/i&#039;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;friend_1\&quot;])) {&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$errormessage&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; .= \&quot; Your 1st friend&#039;s e-mail address is invalid!\&quot;;&lt;br /&gt;}&lt;br /&gt;if(!preg_match(&#039;/^[^@\s&amp;lt;&amp;amp;&amp;gt;]+@([-a-z0-9]+\.)+[a-z]{2,}$/i&#039;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;friend_2\&quot;]) &amp;amp;&amp;amp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;friend_2\&quot;]) {&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$errormessage&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; .= \&quot; Your 2nd friend&#039;s e-mail address is invalid!\&quot;;&lt;br /&gt;}&lt;br /&gt;if(!preg_match(&#039;/^[^@\s&amp;lt;&amp;amp;&amp;gt;]+@([-a-z0-9]+\.)+[a-z]{2,}$/i&#039;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;friend_3\&quot;]) &amp;amp;&amp;amp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;friend_3\&quot;]) {&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$errormessage&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; .= \&quot; Your 3rd friend&#039;s e-mail address is invalid!\&quot;;&lt;br /&gt;}&lt;br /&gt;if(!preg_match(&#039;/^[^@\s&amp;lt;&amp;amp;&amp;gt;]+@([-a-z0-9]+\.)+[a-z]{2,}$/i&#039;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;friend_4\&quot;]) &amp;amp;&amp;amp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;friend_4\&quot;]) {&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$errormessage&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; .= \&quot; Your 4th friend&#039;s e-mail address is invalid!\&quot;;&lt;br /&gt;}&lt;br /&gt;if(!preg_match(&#039;/^[^@\s&amp;lt;&amp;amp;&amp;gt;]+@([-a-z0-9]+\.)+[a-z]{2,}$/i&#039;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;friend_5\&quot;]) &amp;amp;&amp;amp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;friend_5\&quot;]) {&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$errormessage&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; .= \&quot; Your 5th friend&#039;s e-mail address is invalid!\&quot;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if (!&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$errormessage&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;) {&lt;br /&gt;&lt;br /&gt;if (!empty(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;sender_email\&quot;]))&lt;br /&gt;{&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$from&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = \&quot;From: \&quot; . &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$your_email&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; . \&quot;\nContent-type: text/html\n\&quot;;&lt;br /&gt;} else {&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$from&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = \&quot;From: contact@mywebsite.com\nContent-type: text/html\n\&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$your_email&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = \&quot;contact@mywebsite.com\&quot;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$notifyMail&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = \&quot;contact@mywebsite.com\&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$notifySubject&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = \&quot;TV webcasts Was Shared from mywebsite.com\&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$notifyMessage&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = \&quot;The send video script was just used for:\r\n\r\n\&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$notifyMessage&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; .= \&quot;Live Streaming TV Webcasts\r\n\&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$notifyMessage&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; .= \&quot;http://www.mywebsite.com/live-webcasts/\r\n\r\n\&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$notifyMessage&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; .= \&quot;Recipient Email: \&quot; . &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$tomail&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; . \&quot;\r\n\r\n\&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$notifyMessage&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; .= \&quot;Sender: \&quot; . &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;sender_name\&quot;] . \&quot;\r\n\&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$notifyMessage&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; .= \&quot;Sender Email: \&quot; . &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;sender_email\&quot;] . \&quot;\r\n\&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$notifyMessage&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; .= \&quot;Message: \&quot; . &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;extra\&quot;] . \&quot;\r\n\r\n\r\n\&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$notifyMessage&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; .= \&quot;* Complete strangers are promoting mywebsite.com.\&quot;;&lt;br /&gt;&lt;br /&gt;//copy to sender&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$copyfrom&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = \&quot;From: \&quot; . &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;sender_email\&quot;] . \&quot;\&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$copyMail&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;sender_email\&quot;];&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$copySubject&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = \&quot;You sent TV webcasts from mywebsite.com\&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$copyMessage&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = \&quot;*Below is a copy of the email(s) you sent:\r\n\r\n\r\n\&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$copyMessage&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; .= \&quot;When you have a moment, check out these online TV webcasts.\r\n\r\n\&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$copyMessage&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; .= \&quot;Live Streaming TV Webcasts\r\n\r\n\&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$copyMessage&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; .= \&quot;http://www.mywebsite.com/live-webcasts/\r\n\r\n\r\n\&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$copyMessage&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; .= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;extra\&quot;] . \&quot;\r\n\r\n\r\n\&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$copyMessage&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; .= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;sender_name\&quot;] . \&quot;\r\n\r\n\r\n\r\n\&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$copyMessage&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; .= \&quot;________________________________________\r\n\&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$copyMessage&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; .= \&quot;Sent courtesy of: http://www.mywebsite.com/\r\n\r\n\&quot;;&lt;br /&gt;//end of copy email&lt;br /&gt;&lt;br /&gt;//main message&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$from&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = \&quot;From: \&quot; . &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;sender_email\&quot;] . \&quot;\&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$subject&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = \&quot;Check out these online TV webcasts...\&quot;;&lt;br /&gt;&lt;br /&gt;//email format - plain jane text&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$inputMessage&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; .= \&quot;Hi,\r\n\r\n\&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$inputMessage&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; .= \&quot;When you have a moment, check out these online TV webcasts.\r\n\r\n\&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$inputMessage&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; .= \&quot;Live Streaming TV Webcasts\r\n\r\n\&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$inputMessage&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; .= \&quot;http://www.mywebsite.com/live-webcasts/\r\n\r\n\r\n\&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$inputMessage&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; .= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;extra\&quot;] . \&quot;\r\n\r\n\r\n\&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$inputMessage&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; .= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;sender_name\&quot;] . \&quot;\r\n\r\n\r\n\r\n\&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$inputMessage&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; .= \&quot;________________________________________\r\n\&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$inputMessage&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; .= \&quot;Sent courtesy of: http://www.mywebsite.com/\r\n\r\n\&quot;;&lt;br /&gt;//end of email&lt;br /&gt;&lt;br /&gt;//send the email&lt;br /&gt;for (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$x&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = 1; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$x&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; &amp;lt;= 5; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$x&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;++)&lt;br /&gt;mail (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;friend_&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$x&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;], &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$subject&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$inputMessage&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$from&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;);&lt;br /&gt;&lt;br /&gt;//mail (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$notifyMail&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$notifySubject&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$notifyMessage&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;);&lt;br /&gt;if (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;copyMail\&quot;]) {&lt;br /&gt;mail (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$copyMail&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$copySubject&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$copyMessage&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$copyfrom&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;thank you page&amp;lt;/title&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;thank you page text&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
 </description>
     <pubDate>Fri, 23 Nov 2007 18:40:54 +0000</pubDate>
 <dc:creator>Mr. J</dc:creator>
 <guid isPermaLink="false">comment 1226639 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/need-else-if-statement-php-script#comment-1226627</link>
    <description> &lt;p&gt;Your email checking function is a bit too &#039;messy&#039;. Why would you try and replace invalid characters? If someone enters one, simply throw an error at them and ask them to modify their it.&lt;/p&gt;
&lt;p&gt;I would use something like the following regular expression to test email validity (inspired by the book essential PHP security from Chris Shifflet):&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;if(preg_match(&amp;#039;/^[^@\s&amp;lt;&amp;amp;&amp;gt;]+@([-a-z0-9]+\.)+[a-z]{2,}$/i&amp;#039;, $thisEmail)){&lt;br /&gt;&amp;nbsp; //email is ok&lt;br /&gt;}else{&lt;br /&gt;&amp;nbsp; //email invalid&lt;br /&gt;}&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
 </description>
     <pubDate>Thu, 22 Nov 2007 23:04:37 +0000</pubDate>
 <dc:creator>calculator</dc:creator>
 <guid isPermaLink="false">comment 1226627 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/need-else-if-statement-php-script#comment-1226625</link>
    <description> &lt;p&gt;Just quick suggestion.&lt;/p&gt;
&lt;p&gt;Name all the TO fields the same (say &lt;strong&gt;sender_email[]&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Now you will have an array in PHP, , ex. $_POST[&#039;sender_email&#039;][0], $_POST[&#039;sender_email&#039;][1], $_POST[&#039;sender_email&#039;][2] &lt;/p&gt;
&lt;p&gt;Break you code up so it does all the checking of the info that will be the same on every e-mail (sender&#039;s e-mail, setting up the actual message and headers, etc). Then do a loop, simliar to the following:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;foreach ($_POST[&amp;#039;sender_email&amp;#039;] as $thisEmail)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // VALIDATE THE E_MAIL ADDRESS HERE, the current e-mail is in $thisEmail&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // SEND THE E_MAIL HERE&lt;br /&gt;}&lt;/code&gt;&lt;/div&gt;&#039;&lt;br /&gt;
You will probably want to ad checking on each one to make sure each of them actually validate good.&lt;/p&gt;
&lt;p&gt;Just a rough solution for you, normally I&#039;d et more detailed, but kinda tired today.&lt;/p&gt;
&lt;p&gt;-Greg&lt;/p&gt;
 </description>
     <pubDate>Thu, 22 Nov 2007 22:41:21 +0000</pubDate>
 <dc:creator>Greg K</dc:creator>
 <guid isPermaLink="false">comment 1226625 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
