<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>NewSourceMedia Blog &#187; Forms</title>
	<atom:link href="http://newsourcemedia.com/blog/category/php/forms-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://newsourcemedia.com/blog</link>
	<description>Focused on Interactive Design, Development and Marketing</description>
	<lastBuildDate>Sun, 09 May 2010 02:35:53 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PHP Email Form Easy</title>
		<link>http://newsourcemedia.com/blog/php-email-form-easy/</link>
		<comments>http://newsourcemedia.com/blog/php-email-form-easy/#comments</comments>
		<pubDate>Fri, 02 Jul 2004 00:22:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Forms]]></category>
		<category><![CDATA[comunication]]></category>
		<category><![CDATA[cyberxmedia]]></category>
		<category><![CDATA[PHP Email Form Easy]]></category>
		<category><![CDATA[PHP Tips and Tutorials Email Systems]]></category>

		<guid isPermaLink="false">http://newsourcemedia.com/blog/1969/12/31/php-email-form-easy/</guid>
		<description><![CDATA[Now you can send emails from your web sites with full control over design style and functionality. PHP is the way to go for online email form. Here is how to get started.
Now you can send emails from your web sites with full control over design          [...]]]></description>
			<content:encoded><![CDATA[<p>Now you can send emails from your web sites with full control over design style and functionality. PHP is the way to go for online email form. Here is how to get started.<br />
<span id="more-222"></span>Now you can send emails from your web sites with full control over design            style and functionality. PHP is the way to go for online email form.            Here is how to get started.</p>
<p><strong>Step 1: Create E-Mail Form</strong></p>
<p>Here is a sample html email form</p>
<p><span style="color: #009900;">&lt;form action=&#8221;" method=&#8221;post&#8221;&gt;</span><span style="color: #003399;"><br />
Name: &lt;br&gt;<br />
&lt;input type=&#8221;text&#8221; name=&#8221;name&#8221;&gt;<br />
&lt;br&gt;<br />
Email: &lt;br&gt;<br />
&lt;input type=&#8221;text&#8221; name=&#8221;email&#8221;&gt;<br />
&lt;br&gt;<br />
Subject: &lt;br&gt;<br />
&lt;input type=&#8221;text&#8221; name=&#8221;subject&#8221;&gt;<br />
&lt;br&gt;<br />
Text:&lt;br&gt;<br />
&lt;textarea name=&#8221;message&#8221; cols=&#8221;" rows=&#8221;"&gt;&lt;/textarea&gt;&lt;br&gt;<br />
&lt;input type=&#8221;submit&#8221; name=&#8221;submit&#8221; value=&#8221;Send&#8221;&gt;<br />
&lt;input type=&#8221;reset&#8221; name=&#8221;Reset&#8221; value=&#8221;Reset&#8221;&gt;<br />
<span style="color: #009900;">&lt;/form&gt;</span></span></p>
<p>Copy the html code above and past it into a file with the name contactus.php</p>
<p>Now its time to add the php code.</p>
<p><strong>Step 2: Sending the data</strong></p>
<p>We will first check to see if the form was submitted then we will check to see if all fields were filled in. If all is well, we well send each form data to it&#8217;s perspective variables (indicated by the sign &#8220;$&#8221;) and send out the email with a successful message. If all field were not filled-in, then display an error message. The php code is below.</p>
<p><span style="color: #006600;">&lt;?php<br />
if ($submit) { <span style="color: #ff9900;">// if the form was sent do the            following</span></span></p>
<p><span style="color: #006600;">if($name &amp;&amp; $subject            &amp;&amp; $email &amp;&amp; $message ) { <span style="color: #ff9900;">// if            all fields were filled-in send email</span><br />
mail(&#8220;you@youraddress.com&#8221;,&#8221;$subject&#8221;,&#8221;$message&#8221;,&#8221;From:            $name &lt;$email&gt;&#8221;) or die(&#8220;email error&#8221;);<br />
echo &#8220;Message Sent&#8221;; <span style="color: #ff9900;">// if all went            well, display message was sent</span><br />
} else {<br />
echo &#8220;All fields must be filled in!&lt;BR&gt;&#8221;; <span style="color: #ff9900;">//            if not all were filled in, display error message</span><br />
}<br />
} <span style="color: #ff9900;">// end php submission code</span><br />
?&gt;</span></p>
<p>Now just copy and past the php code above into the &#8220;contactus.php&#8221;    file. You can place it anywhere inside the body tag and it will work just fine.</p>
<p>Be sure to check for the next PHP Advanced Email Form coming soon to NewSourceMedia.com    .</p>
<p><!--   Start of HTML Code   ---></p>
<table border="1" cellspacing="0" cellpadding="4" width="250" bgcolor="#d70500" bordercolor="#840300">
<form action="http://www.hotscripts.com/cgi-bin/rate.cgi" method="post">
<tbody>
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td><strong><span style="font-family: Verdana,Arial; color: #ffffff; font-size: xx-small;">If you like our  script, please rate it!</span></strong></p>
<input name="ID" type="hidden" value="28522" />
<input name="external" type="hidden" value="1" /></td>
</tr>
<tr>
<td>
<select name="rate" size="1"> <option selected="selected" value="5">Excellent!</option> <option value="4">Very Good</option> <option value="3">Good</option> <option value="2">Fair</option> <option value="1">Poor</option> </select>
<input name="submit" type="submit" value="Cast My Vote!" /></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</form>
</table>
<p><!--   End of HTML Code   --->Amazon.com has a variety of book on PHP <a href="http://www.amazon.com/exec/obidos/external-search/102-4705021-0991362?mode=books&amp;keyword=PHP&amp;Go=Go&amp;tag=newsourcemedi-20" target="_blank">Click    here to see the list of PHP books available.</a></p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://newsourcemedia.com/blog/php-lesson-1-first-php-script/" rel="bookmark">PHP Lesson 1 - First PHP Script</a></li><li><a href="http://newsourcemedia.com/blog/sending-email-with-php/" rel="bookmark">Sending Email with PHP</a></li><li><a href="http://newsourcemedia.com/blog/php-remove-non-alphanumeric-characters/" rel="bookmark">Php Remove Non-Alphanumeric Characters</a></li><li><a href="http://newsourcemedia.com/blog/php-lesson-2-add-comments/" rel="bookmark">PHP Lesson 2 - Add Comments</a></li><li><a href="http://newsourcemedia.com/blog/advanced-email-link/" rel="bookmark">Advanced Email Link</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://newsourcemedia.com/blog/php-email-form-easy/feed/</wfw:commentRss>
		<slash:comments>53</slash:comments>
		</item>
		<item>
		<title>PHP Validation Numbers Only From</title>
		<link>http://newsourcemedia.com/blog/php-validation-numbers-only-from/</link>
		<comments>http://newsourcemedia.com/blog/php-validation-numbers-only-from/#comments</comments>
		<pubDate>Tue, 30 Nov 1999 06:00:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Forms]]></category>
		<category><![CDATA[Math and Numbers]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[credit card]]></category>
		<category><![CDATA[digit]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[integer]]></category>
		<category><![CDATA[numbers]]></category>
		<category><![CDATA[phone number]]></category>
		<category><![CDATA[string]]></category>
		<category><![CDATA[validate]]></category>
		<category><![CDATA[zip code]]></category>

		<guid isPermaLink="false">http://newsourcemedia.com/blog/1969/12/31/php-validation-numbers-only-from/</guid>
		<description><![CDATA[How to check for number values only and block or convert letter strings to integers.

Question: How to validate number values to and block all letters and symbol in a form.
Answer: You can check the value or convert the value to an integer (number).
1) Check a value using is_int() to finds whether the given variable is [...]]]></description>
			<content:encoded><![CDATA[<p>How to check for number values only and block or convert letter strings to integers.<br />
<span id="more-170"></span></p>
<p><strong>Question:</strong> How to validate number values to and block all letters and symbol in a form.</p>
<p><strong>Answer:</strong> You can check the value or convert the value to an integer (number).</p>
<p>1) Check a value using is_int() to finds whether the given variable is an integer</p>
<p><code>&lt;?<br />
if(is_int($variable))<br />
echo "Pass test";<br />
else<br />
echo "Please use only numbers";<br />
?&gt; </code></p>
<p>2) Note: To test if a variable is a number or a numeric string (such as form input, which is always a string), you must use is_numeric().</p>
<p><code>&lt;?<br />
if(is_numeric($variable))<br />
echo "Pass test";<br />
else<br />
echo "Please use only numbers";<br />
?&gt; </code></p>
<p>3) Convert the value to an integer (number) using settype.</p>
<p><code>&lt;?php<br />
$foo = "5bar"; // string<br />
$bar = true; // boolean</code></p>
<p>settype($foo, &#8220;integer&#8221;); // $foo is now 5 (integer)<br />
settype($bar, &#8220;string&#8221;); // $bar is now &#8220;1&#8243; (string)<br />
?&gt;</p>
<p>or you can use int to do the trick.</p>
<p><code><br />
&lt;?<br />
$int=593; // $int is a integer<br />
$int.=""; // $int is now a string<br />
?&gt;<br />
</code></p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://newsourcemedia.com/blog/php-leading-zero-for-double-digit-numbers/" rel="bookmark">PHP Leading Zero for Double Digit Numbers</a></li><li><a href="http://newsourcemedia.com/blog/mysql-table-fields-data-types/" rel="bookmark">MySQL Table Fields Data Types</a></li><li><a href="http://newsourcemedia.com/blog/php-strip-remove-white-space-from-end-of-string/" rel="bookmark">PHP strip remove white space from end of string</a></li><li><a href="http://newsourcemedia.com/blog/php-round-off-decimal-or-convert-to-decimal-point/" rel="bookmark">PHP Round Off Decimal or Convert to Decimal Point</a></li><li><a href="http://newsourcemedia.com/blog/php-remove-non-alphanumeric-characters/" rel="bookmark">Php Remove Non-Alphanumeric Characters</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://newsourcemedia.com/blog/php-validation-numbers-only-from/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>POST/GET Form Variables</title>
		<link>http://newsourcemedia.com/blog/postget-form-variables/</link>
		<comments>http://newsourcemedia.com/blog/postget-form-variables/#comments</comments>
		<pubDate>Sat, 28 Feb 2004 00:22:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Forms]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[debugging.]]></category>
		<category><![CDATA[display]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[get]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[post]]></category>
		<category><![CDATA[srtings]]></category>
		<category><![CDATA[values]]></category>

		<guid isPermaLink="false">http://newsourcemedia.com/blog/2004/02/27/postget-form-variables/</guid>
		<description><![CDATA[Using PHP array functions to view all of your POST/GET Variables make it easy for retrieving data from online forms. It&#8217;s also great for debugging your codes.

Introduction:
To view all of the POST/GET Variables, you could use the following PHP statements.
NOTE: Make sure that &#8220;REGISTER_GLOBALS&#8221; are turned ON and DO NOT USE (enctype=&#8221;text/plain&#8221;) in your form [...]]]></description>
			<content:encoded><![CDATA[<p>Using PHP array functions to view all of your POST/GET Variables make it easy for retrieving data from online forms. It&#8217;s also great for debugging your codes.<br />
<span id="more-210"></span><br />
Introduction:</p>
<p>To view all of the POST/GET Variables, you could use the following PHP statements.</p>
<p>NOTE: Make sure that &#8220;REGISTER_GLOBALS&#8221; are turned ON and DO NOT USE (enctype=&#8221;text/plain&#8221;) in your form tag or you may not be able to retrieve the posted values.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?</span> 
<span style="color: #990000;">print_r</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #666666; font-style: italic;">// or</span>
<span style="color: #990000;">print_r</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>or you may want to see all POST/GET variables including global variables like cookies set by your web site.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?</span>
<span style="color: #990000;">print_r</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Here is a sample as to how the data will display after posting your form by using the above PHP statements:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #990000;">Array</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#91;</span>textfield1<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> Alexander <span style="color: #009900;">&#91;</span>textfield1<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span> <span style="color: #009900;">&#91;</span>submit<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> Submit <span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>If you would like to change the way your POST/GET Array variables are displayed, you could do the following:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?</span>
<span style="color: #990000;">echo</span> <span style="color: #0000ff;">&quot;POST/GET Variables:&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$val</span><span style="color: #009900;">&#41;</span>
<span style="color: #990000;">echo</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$key</span> =<span style="color: #006699; font-weight: bold;">$val</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>The the code above should display something like this:</p>
<p>POST/GET Variables:<br />
textfield =Mike<br />
textfield2 =Tome<br />
textfield3 =Sue<br />
textfield4 =Bob<br />
Submit =Submit<br />
To view a working sample using the GET method, <a href="http://newsourcemedia.com/Tutorials/PHP-PostGetVariables2.php">click here!</a></p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://newsourcemedia.com/blog/php-email-form-easy/" rel="bookmark">PHP Email Form Easy</a></li><li><a href="http://newsourcemedia.com/blog/register_globals-workaround-for-config-on-or-off/" rel="bookmark">Register_Globals workaround for config on or off</a></li><li><a href="http://newsourcemedia.com/blog/php-lesson-3-creating-functions/" rel="bookmark">PHP Lesson 3 - Creating Functions</a></li><li><a href="http://newsourcemedia.com/blog/array-lesson-part-1/" rel="bookmark">Array: Lesson Part 1</a></li><li><a href="http://newsourcemedia.com/blog/php-lesson-1-first-php-script/" rel="bookmark">PHP Lesson 1 - First PHP Script</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://newsourcemedia.com/blog/postget-form-variables/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->