<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[PHP Forums - General]]></title>
	<link rel="self" href="http://phpforums.org/feed-atom-forum1.xml"/>
	<updated>2010-07-01T22:36:38Z</updated>
	<generator>PunBB</generator>
	<id>http://phpforums.org/</id>
		<entry>
			<title type="html"><![CDATA[What PHP editor do you use?]]></title>
			<link rel="alternate" href="http://phpforums.org/topic4-what-php-editor-do-you-use-new-posts.html"/>
			<summary type="html"><![CDATA[<p>What editor you are using to do your PHP work? Feel free to let us know your opinion about it.</p><p>Personally, I do my PHP development work with the help of Aptana and Notepad++. I love the speed of Notepad++ and the feature set of Aptana. Both are great and feature full PHP editors, which satisfy my needs to the fullest.</p><br /><p>How about you?</p>]]></summary>
			<author>
				<name><![CDATA[talviruusu]]></name>
				<uri>http://phpforums.org/user2.html</uri>
			</author>
			<updated>2010-07-01T22:36:38Z</updated>
			<id>http://phpforums.org/topic4-what-php-editor-do-you-use-new-posts.html</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[[TUTORIAL] How to make a simple contact form]]></title>
			<link rel="alternate" href="http://phpforums.org/topic16-tutorial-how-to-make-a-simple-contact-form-new-posts.html"/>
			<summary type="html"><![CDATA[<p>Hello,</p><p>In this tutorial you will learn how to make a simple contact form:</p><div class="codebox"><pre><code>&lt;?php
if(isset($_POST[&#039;submit&#039;])) {
 

$to = &quot;you@you.com&quot;;
$subject = &quot;Form Tutorial&quot;;
$name_field = $_POST[&#039;name&#039;];
$email_field = $_POST[&#039;email&#039;];
$message = $_POST[&#039;message&#039;];
$option = $_POST[&#039;radio&#039;];
$dropdown = $_POST[&#039;drop_down&#039;];
 
foreach($_POST[&#039;check&#039;] as $value) {

$check_msg .= &quot;Checked: $value\n&quot;;

}
 
$body = &quot;From: $name_field\n E-Mail: $email_field\n $check_msg Option: $option\n Drop-Down: $dropdown\n Message:\n $message\n&quot;;
 
echo &quot;Data has been submitted to $to!&quot;;
mail($to, $subject, $body);
 

} else {
?&gt;

&lt;form method=&quot;POST&quot; action=&quot;mailer.php&quot;&gt;
Name:
&lt;input type=&quot;text&quot; name=&quot;name&quot; size=&quot;19&quot;&gt;&lt;br&gt;
&lt;br&gt;
E-Mail:
&lt;input type=&quot;text&quot; name=&quot;email&quot; size=&quot;19&quot;&gt;&lt;br&gt;
&lt;br&gt;
 
&lt;input type=&quot;checkbox&quot; name=&quot;check[]&quot; value=&quot;blue_color&quot;&gt; Blue&lt;br&gt;
&lt;input type=&quot;checkbox&quot; name=&quot;check[]&quot; value=&quot;green_color&quot;&gt; Green&lt;br&gt;
&lt;input type=&quot;checkbox&quot; name=&quot;check[]&quot; value=&quot;orange_color&quot;&gt; Orange&lt;br&gt;
&lt;br&gt;
&lt;input type=&quot;radio&quot; value=&quot;yes&quot; name=&quot;radio&quot;&gt; YES&lt;br&gt;
&lt;input type=&quot;radio&quot; value=&quot;no&quot; name=&quot;radio&quot;&gt; NO
&lt;br&gt;
&lt;br&gt;
 
&lt;select size=&quot;1&quot; name=&quot;drop_down&quot;&gt;
&lt;option&gt;php&lt;/option&gt;
&lt;option&gt;xml&lt;/option&gt;
&lt;option&gt;asp&lt;/option&gt;
&lt;option&gt;jsp&lt;/option&gt;
&lt;/select&gt;&lt;br&gt;
&lt;br&gt;
Message:&lt;br&gt;
&lt;textarea rows=&quot;9&quot; name=&quot;message&quot; cols=&quot;30&quot;&gt;&lt;/textarea&gt;&lt;br&gt;
&lt;br&gt;
&lt;input type=&quot;submit&quot; value=&quot;Submit&quot; name=&quot;submit&quot;&gt;
&lt;/form&gt;

&lt;?php
}
?&gt;</code></pre></div>]]></summary>
			<author>
				<name><![CDATA[jaydesigns]]></name>
				<uri>http://phpforums.org/user8.html</uri>
			</author>
			<updated>2009-12-17T23:09:17Z</updated>
			<id>http://phpforums.org/topic16-tutorial-how-to-make-a-simple-contact-form-new-posts.html</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[[TUTORIAL] How to make a simple captcha script]]></title>
			<link rel="alternate" href="http://phpforums.org/topic14-tutorial-how-to-make-a-simple-captcha-script-new-posts.html"/>
			<summary type="html"><![CDATA[<p>Hello,</p><p>Here is a tutorial on how to make a simple captcha script</p><div class="codebox"><pre><code>&lt;?php
session_start();
$strlength = rand(4,7);

for($i=1;$i&lt;=$strlength;$i++)
{
$textornumber = rand(1,3);
if($textornumber == 1)
{
$captchastr .= chr(rand(49,57));
}
if($textornumber == 2)
{
$captchastr .= chr(rand(65,78));
}
if($textornumber == 3)
{
$captchastr .= chr(rand(80,90));
}
}
$randcolR = rand(100,230);
$randcolG = rand(100,230);
$randcolB = rand(100,230);

/initialize image $captcha is handle dimensions 200,50
$captcha = imageCreate(200,50);
$backcolor = imageColorAllocate($captcha, $randcolR, $randcolG, $randcolB);

$txtcolor = imageColorAllocate($captcha, ($randcolR - 20), ($randcolG - 20), ($randcolB - 20));
for($i=1;$i&lt;=$strlength;$i++)
{

$clockorcounter = rand(1,2);
if ($clockorcounter == 1)
{
$rotangle = rand(0,45);
}
if ($clockorcounter == 2)
{
$rotangle = rand(315,360);
}

//$i*25 spaces the characters 25 pixels apart
imagettftext($captcha,rand(14,20),$rotangle,($i*25),30,$txtcolor,&quot;/arial.ttf&quot;,substr($captchastr,($i-1),1));
}
for($i=1; $i&lt;=4;$i++)
{
imageellipse($captcha,rand(1,200),rand(1,50),rand(50,100),rand(12,25),$txtcolor);
}
for($i=1; $i&lt;=4;$i++)
{
imageellipse($captcha,rand(1,200),rand(1,50),rand(50,100),rand(12,25),$backcolor);
}
//Send the headers (at last possible time)
header(&#039;Content-type: image/png&#039;);

//Output the image as a PNG
imagePNG($captcha);

//Delete the image from memory
imageDestroy($captcha);

$_SESSION[captchastr] = $captchastr;

?&gt;</code></pre></div>]]></summary>
			<author>
				<name><![CDATA[Orrymain]]></name>
				<uri>http://phpforums.org/user8.html</uri>
			</author>
			<updated>2009-11-20T01:35:13Z</updated>
			<id>http://phpforums.org/topic14-tutorial-how-to-make-a-simple-captcha-script-new-posts.html</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[[TUTORIAL] How to make a simple calculator]]></title>
			<link rel="alternate" href="http://phpforums.org/topic15-tutorial-how-to-make-a-simple-calculator-new-posts.html"/>
			<summary type="html"><![CDATA[<p>Hello,</p><p>In this tutorial you will learn how to make a simple PHP calculator</p><div class="codebox"><pre><code>&lt;?php

if($submit)
{
   if($operator == &#039;*&#039;)
   {
       echo $numa * $numb;
   } elseif($operator == &#039;/&#039;)
   {
       echo $numa / $numb;
   } elseif($operator == &#039;+&#039;)
   {
       echo $numa + $numb;
   } elseif($operator == &#039;-&#039;)
   {
       echo $numa - $numb;
   }
} else { ?&gt;
&lt;form method=&quot;POST&quot; action=&quot;&lt;?php $_SERVER[&#039;PHP_SELF&#039;]; ?&gt;&quot;&gt;
 &lt;input type=&quot;text&quot; name=&quot;numa&quot; size=&quot;10&quot;&gt;
 &lt;select name=&quot;operator&quot;&gt;
 &lt;option value=&quot;+&quot;&gt;Add&lt;/option&gt;
 &lt;option value=&quot;-&quot;&gt;Subtract&lt;/option&gt;
 &lt;option value=&quot;*&quot;&gt;Multiply&lt;/option&gt;
 &lt;option value=&quot;/&quot;&gt;Divide&lt;/option&gt;
 &lt;/select&gt;
 &lt;input type=&quot;text&quot; name=&quot;numb&quot; size=&quot;10&quot;&gt;
 &lt;input type=&quot;submit&quot; value=&quot;Calculate&quot; name=&quot;submit&quot;&gt;
&lt;/form&gt;
&lt;?php } ?&gt;

Read more: http://www.webdesign.org/web/web-programming/php/php-calculator.10025.html#ixzz0TUVwwSds</code></pre></div>]]></summary>
			<author>
				<name><![CDATA[Orrymain]]></name>
				<uri>http://phpforums.org/user8.html</uri>
			</author>
			<updated>2009-11-17T20:54:26Z</updated>
			<id>http://phpforums.org/topic15-tutorial-how-to-make-a-simple-calculator-new-posts.html</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[[Tutorial] How to find if a number is odd or even]]></title>
			<link rel="alternate" href="http://phpforums.org/topic13-tutorial-how-to-find-if-a-number-is-odd-or-even-new-posts.html"/>
			<summary type="html"><![CDATA[<p>Hi there!</p><p>In this tutorial I&#039;ll write some basic PHP code on how to find if a number is odd or even.</p><p>The idea behind the code is that even numbers have zero reminder when divided by 2, while odd numbers have 1 as a reminder after division by 2. For this I&#039;ll use PHP modulus operator (%).</p><div class="codebox"><pre><code>&lt;?php
if ($number % 2 == 0)
{
    echo &quot;even&quot;;
}
else
{
    echo &quot;odd&quot;;
}
?&gt;</code></pre></div>]]></summary>
			<author>
				<name><![CDATA[Einherjar]]></name>
				<uri>http://phpforums.org/user2.html</uri>
			</author>
			<updated>2009-10-08T23:27:10Z</updated>
			<id>http://phpforums.org/topic13-tutorial-how-to-find-if-a-number-is-odd-or-even-new-posts.html</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[[Tutorial] How to generate a random number in PHP]]></title>
			<link rel="alternate" href="http://phpforums.org/topic12-tutorial-how-to-generate-a-random-number-in-php-new-posts.html"/>
			<summary type="html"><![CDATA[<p>Hello!</p><p>Here is some basic tutorial on how to generate a random number in PHP.</p><p>Random numbers in PHP are generated using the rand() function. Let&#039;s write some code that will generate a random number between 1 and 10.</p><div class="codebox"><pre><code>&lt;?php
echo rand(1, 10);
?&gt;</code></pre></div><p>If you need more than one random number generated, use rand() function in a loop. Here is a code for generating three random numbers between 10 and 20.</p><div class="codebox"><pre><code>&lt;?php
for ($i = 0; $i &lt; 3; $i++)
{
    echo rand(10, 20) . &quot; &quot;;
}
?&gt;</code></pre></div>]]></summary>
			<author>
				<name><![CDATA[Einherjar]]></name>
				<uri>http://phpforums.org/user2.html</uri>
			</author>
			<updated>2009-10-08T21:29:49Z</updated>
			<id>http://phpforums.org/topic12-tutorial-how-to-generate-a-random-number-in-php-new-posts.html</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[[Tutorial] How to Get email after user buys something from your paypal]]></title>
			<link rel="alternate" href="http://phpforums.org/topic9-tutorial-how-to-get-email-after-user-buys-something-from-your-paypal-new-posts.html"/>
			<summary type="html"><![CDATA[<p>Hello,</p><p>Here is a tutorial on how to find out instantly when someone makes a purchase from your paypal</p><p>in this tutorial there will be 2 files</p><p>-payment.php -Gets Info<br />-orderconfirmation.php -Processes Info<br />================================</p><p>payment.php:</p><div class="codebox"><pre><code>&lt;?php 
/*
Free Payment Proccessing Script
Script Designed by JayDesigns
JayDesigns@live.com
*/

?&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt; Order Page &lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
div {
background-color:#b0c4de;
margin-top:100px;
margin-bottom:100px;
margin-right:400px;
margin-left:400px;
border-style:solid;
border-color:#98bf21;

} 



&lt;/style&gt;

&lt;/head&gt;
&lt;body bgcolor=&quot;e5e4e4&quot;&gt;
&lt;center&gt;
&lt;div&gt;
&lt;h1&gt; Order Page &lt;/h1&gt;


&lt;?php
if(isset($_GET[&#039;submit&#039;])){

$email = $_GET[&#039;email&#039;];
$name = $_GET[&#039;name&#039;];

?&gt;
&lt;div&gt;
&lt;td width=&quot;33%&quot; style=&quot;border-style: none; border-width: medium;&quot;&gt;
                  
&lt;form action=&quot;https://www.paypal.com/cgi-bin/webscr&quot; method=&quot;post&quot;&gt;
&lt;input type=&quot;hidden&quot; value=&quot;_xclick&quot; name=&quot;cmd&quot;&gt;
&lt;input type=&quot;hidden&quot; value=&quot;JneroCorp12345@gmail.com&quot; name=&quot;business&quot;&gt;
&lt;input type=&quot;hidden&quot; value=&quot;Item Name&quot; name=&quot;item_name&quot;&gt;
&lt;table&gt;
&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;
  &lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt;&quot;&gt;&lt;font size=&quot;3&quot;&gt;Select&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;
  &lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt;&quot;&gt; &lt;/p&gt;
  &lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt;&quot;&gt;&lt;select name=&quot;amount&quot;&gt;
    &lt;option value=&quot;10.00&quot;&gt; $10.00
    &lt;/option&gt;&lt;option value=&quot;20.00&quot;&gt; $20.00
    &lt;/option&gt;&lt;option value=&quot;30.00&quot;&gt; $30.00
&lt;/option&gt;&lt;/select&gt; &lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;

&lt;input type=&quot;hidden&quot; value=&#039;./orderconfirmation.php?email=&lt;?php echo &quot;$email&quot;; ?&gt;&amp;name=&lt;?php echo &quot;$name&quot;; ?&gt;&#039; name=&quot;return&quot;&gt;
&lt;input type=&quot;hidden&quot; value=&quot;1&quot; name=&quot;no_note&quot;&gt;
&lt;input type=&quot;hidden&quot; value=&quot;USD&quot; name=&quot;currency_code&quot;/&gt;

&lt;input type=&quot;image&quot; height=&quot;47&quot; border=&quot;0&quot; width=&quot;122&quot; alt=&quot;&quot; name=&quot;submit&quot; src=&quot;http://www.call52.com/btn_buynowCC_LG.gif&quot;/&gt;
&lt;img height=&quot;1&quot; border=&quot;0&quot; width=&quot;1&quot; src=&quot;pixel.gif&quot; alt=&quot;&quot;/&gt;
&lt;/form&gt;

&lt;/td&gt;

&lt;/div&gt;



&lt;form action=&quot;&lt;?php echo $_SERVER[&#039;PHP_SELF&#039;]; ?&gt;&quot; method=&quot;get&quot;&gt;
Name: &lt;input type=&quot;text&quot; name=&quot;name&quot;&gt;&lt;br&gt;
Email: &lt;input type=&quot;text&quot; name=&quot;email&quot;&gt;&lt;br&gt;
&lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;submit&quot;&gt;
&lt;/form&gt;&lt;br&gt;&lt;br&gt;
&lt;font size=&quot;1&quot;&gt;Payment Script Developed by JayDesigns@live.com&lt;/font&gt;
&lt;/div&gt;
&lt;?php

}
?&gt;

&lt;/center&gt;
&lt;/body&gt;
&lt;/html&gt;
?&gt;

&lt;/center&gt;</code></pre></div><p>and this would be the code for the orderconfirmation.php</p><div class="codebox"><pre><code>&lt;?php
/*
Free Payment Proccessing Script
Script Designed by JayDesigns
JayDesigns@live.com
*/

$myemail = &quot;youremail@domain.com&quot;; //Your Email Address

if(isset($_GET[&#039;email&#039;])){

$name = $_GET[&#039;name&#039;];
$email = $_GET[&#039;email&#039;];

$to      = &quot;$myemail&quot;;
$subject = &#039;Paypal Purchase Made&#039;;
$message = &quot;A Paypal Purchase has been made bu $name , \r\n \r\n Here is the Information: \r\n Email: $email&quot;;
$headers = &quot;From: $myemail&quot; . &#039;\r\n&#039; . &quot;Reply-To: $myemail&quot; . &#039;\r\n&#039; . &quot;X-Mailer: PHP/&quot; . phpversion();

mail($to, $subject, $message, $headers);

} else {
?&gt;
&lt;font color=&quot;red&quot;&gt; Invalid Parameters &lt;/font&gt;

&lt;?php
}
?&gt;</code></pre></div>]]></summary>
			<author>
				<name><![CDATA[jaydesigns]]></name>
				<uri>http://phpforums.org/user8.html</uri>
			</author>
			<updated>2009-10-04T03:22:34Z</updated>
			<id>http://phpforums.org/topic9-tutorial-how-to-get-email-after-user-buys-something-from-your-paypal-new-posts.html</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[[Tutorial] How to make a Password Protected Page]]></title>
			<link rel="alternate" href="http://phpforums.org/topic7-tutorial-how-to-make-a-password-protected-page-new-posts.html"/>
			<summary type="html"><![CDATA[<p>Hello,</p><p>here is a tutorial on how to make a password protected page</p><p>demo: <a href="http://joeyelectric.com/demos/password.php">http://joeyelectric.com/demos/password.php</a></p><p>=========================================<br />In this tutorial we will use the crypt(); command to encrypt our passwords</p><p>files?<br />-password.php<br />==========================================</p><p>First open a new document in a text editor I use Notepad ++ (Free Opensource text editor)<br />Now Put this code in their<br /></p><div class="codebox"><pre><code>&lt;html&gt;
&lt;head&gt;
&lt;title&gt; Password Test &lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;center&gt;
&lt;h1&gt; Password Test &lt;/h1&gt;

&lt;/body&gt;
&lt;/html&gt;</code></pre></div><p>Next we will create the form:<br />you will notice that for the <strong>action=&quot;&quot;</strong> we have used &quot;<strong>&lt;?php echo $_SERVER[&#039;PHP_SELF&#039;]; ?&gt;</strong>&quot; this will make it so that all the form is processed in password.php<br /></p><div class="codebox"><pre><code>&lt;form action=&quot;&lt;?php echo $_SERVER[&#039;PHP_SELF&#039;]; ?&gt;&quot; method=&quot;post&quot;&gt;
&lt;input type=&quot;text&quot; name=&quot;password&quot;&gt;
&lt;input type=&quot;submit&quot; name=&quot;enter&quot; value=&quot;submit&quot;&gt;
&lt;/form&gt;</code></pre></div><p>now we will add the functions to the script</p><div class="codebox"><pre><code>&lt;?php

if(isset($_GET[&#039;enter&#039;])){

$user_input = $_POST[&#039;password&#039;]; //This is the password the user typed
$user_input_crypt = crypt($user_input); //This will encrypt the password
$password = crypt(&#039;mypassword&#039;); //This is the actual password before it is encrypted about to be encrypted


if (crypt($user_input, $password) == $password) { // This determines whether the passwords match or not 
   echo &quot;&lt;font color=&#039;green&#039;&gt;Correct Password!&lt;/font&gt;&quot;; // if the password is correct this is displayed
} else {

  echo &quot;&lt;font color=&#039;red&#039;&gt;Incorrect Password!&lt;/font&gt;&lt;br&gt;&lt;br&gt;&quot;;
  echo &quot;The Password you typed came back as: $user_input_crypt &lt;br&gt; it should have been: $password&quot;; // if not this is displayed
  
  }

} else {

$password = crypt(&#039;sc55207&#039;);




?&gt;</code></pre></div><p>Now here is the code all put together:</p><div class="codebox"><pre><code>&lt;html&gt;
&lt;head&gt;
&lt;title&gt; Password Test &lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;center&gt;
&lt;h1&gt; Password Test &lt;/h1&gt;


&lt;?php

if(isset($_GET[&#039;enter&#039;])){

$user_input = $_POST[&#039;password&#039;];
$user_input_crypt = crypt($user_input);
$password = crypt(&#039;sc55207&#039;);


if (crypt($user_input, $password) == $password) {
   echo &quot;&lt;font color=&#039;green&#039;&gt;Correct Password!&lt;/font&gt;&quot;;
} else {

  echo &quot;&lt;font color=&#039;red&#039;&gt;Incorrect Password!&lt;/font&gt;&lt;br&gt;&lt;br&gt;&quot;;
  echo &quot;The Password you typed came back as: $user_input_crypt &lt;br&gt; it should have been: $password&quot;;
  
  }

} else {

$password = crypt(&#039;sc55207&#039;);




?&gt;

&lt;form action=&quot;&lt;?php echo $_SERVER[&#039;PHP_SELF&#039;]; ?&gt;&quot; method=&quot;post&quot;&gt;
&lt;input type=&quot;text&quot; name=&quot;password&quot;&gt;
&lt;input type=&quot;submit&quot; name=&quot;enter&quot; value=&quot;submit&quot;&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre></div>]]></summary>
			<author>
				<name><![CDATA[jaydesigns]]></name>
				<uri>http://phpforums.org/user8.html</uri>
			</author>
			<updated>2009-10-04T03:04:33Z</updated>
			<id>http://phpforums.org/topic7-tutorial-how-to-make-a-password-protected-page-new-posts.html</id>
		</entry>
</feed>
