<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[PHP Forums]]></title>
	<link rel="self" href="http://phpforums.org/feed-atom.xml"/>
	<updated>2010-07-25T22:46:03Z</updated>
	<generator>PunBB</generator>
	<id>http://phpforums.org/</id>
		<entry>
			<title type="html"><![CDATA[PHP/MySql Login Verification]]></title>
			<link rel="alternate" href="http://phpforums.org/topic32-phpmysql-login-verification-new-posts.html"/>
			<summary type="html"><![CDATA[<p>Hey guys,&nbsp; I&#039;m a new web developer doing things kinda out of my reach so if I sound stupid I&#039;m sorry.&nbsp; I am trying to create a mysql database with usernames and passwords which php will connect to and verify, then in turn redirect the user accordingly.&nbsp; I found a script that does just that but I have some questions about it.<br />I created the Mysql database as such...<br /></p><div class="codebox"><pre><code>CREATE TABLE tbl_auth_user (
user_id VARCHAR(10) NOT NULL,
user_password CHAR(32) NOT NULL,

PRIMARY KEY (user_id)
);

INSERT INTO tbl_auth_user (user_id, user_password) VALUES (&#039;theadmin&#039;, PASSWORD(&#039;chumbawamba&#039;));
INSERT INTO tbl_auth_user (user_id, user_password) VALUES (&#039;webmaster&#039;, PASSWORD(&#039;webmistress&#039;));


//Now that that is created I looked at the PHP code and this is what I have questions on.

&lt;?php
// we must never forget to start the session
session_start();

$errorMessage = &#039;&#039;;
if (isset($_POST[&#039;txtUserId&#039;]) &amp;&amp; isset($_POST[&#039;txtPassword&#039;])) {
   include &#039;library/config.php&#039;;
   include &#039;library/opendb.php&#039;;

   $userId = $_POST[&#039;txtUserId&#039;];
   $password = $_POST[&#039;txtPassword&#039;];

   // check if the user id and password combination exist in database
   $sql = &quot;SELECT user_id
           FROM tbl_auth_user
           WHERE user_id = &#039;$userId&#039;
                 AND user_password = PASSWORD(&#039;$password&#039;)&quot;;

   $result = mysql_query($sql)
             or die(&#039;Query failed. &#039; . mysql_error());

   if (mysql_num_rows($result) == 1) {
      // the user id and password match,
      // set the session
      $_SESSION[&#039;db_is_logged_in&#039;] = true;

      // after login we move to the main page
      header(&#039;Location: main.php&#039;);
      exit;
   } else {
      $errorMessage = &#039;Sorry, wrong user id / password&#039;;
   }

   include &#039;library/closedb.php&#039;;
}
?&gt;</code></pre></div><p>The part that confuses me is the library directory.&nbsp; Do I actually have to create a library directory and the files called closedb.php and opendb.php or is this some apache built in server feature.&nbsp; If i do need to create the directory... are these files already created?&nbsp; The reason I ask is because in the tutorial he gave no source to these files, so I am wondering if they are a standard web script that can be obtained someplace.</p><p>Thank you for any input you may have in advance,<br />Squeaker2</p>]]></summary>
			<author>
				<name><![CDATA[squeaker2]]></name>
				<uri>http://phpforums.org/user44.html</uri>
			</author>
			<updated>2010-07-25T22:46:03Z</updated>
			<id>http://phpforums.org/topic32-phpmysql-login-verification-new-posts.html</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[[Tutorial] How to connect to MYSQL Database]]></title>
			<link rel="alternate" href="http://phpforums.org/topic10-tutorial-how-to-connect-to-mysql-database-new-posts.html"/>
			<summary type="html"><![CDATA[<p>It is very simple to connect to a mysql database:</p><p>just use this simple code:</p><div class="codebox"><pre><code>&lt;?php
mysql_connect(&quot;localhost&quot;, &quot;username&quot;, &quot;password&quot;) or die(mysql_error());
echo &quot;Connected to MySQL&lt;br /&gt;&quot;;
mysql_select_db(&quot;database&quot;) or die(mysql_error());
echo &quot;Connected to Database&quot;;
?&gt;</code></pre></div>]]></summary>
			<author>
				<name><![CDATA[talviruusu]]></name>
				<uri>http://phpforums.org/user8.html</uri>
			</author>
			<updated>2010-07-01T22:47:51Z</updated>
			<id>http://phpforums.org/topic10-tutorial-how-to-connect-to-mysql-database-new-posts.html</id>
		</entry>
		<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[date n time]]></title>
			<link rel="alternate" href="http://phpforums.org/topic27-date-n-time-new-posts.html"/>
			<summary type="html"><![CDATA[<p>I know that my question may sound stupid, but I&#039;ll ask anyway...</p><div class="codebox"><pre><code>$username = $_POST[&#039;username&#039;];
$email = $_POST[&#039;email&#039;];
$password = md5($_POST[&#039;password&#039;]);
$password2 = md5($_POST[&#039;password2&#039;]);
$location = $_POST[&#039;location&#039;];
$genre = $_POST[&#039;genre&#039;];
$date =</code></pre></div><p>what should I write to insert date and time in the database and what type should I specify on the database side?</p><p>thanks a lot <img src="http://phpforums.org/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></summary>
			<author>
				<name><![CDATA[talviruusu]]></name>
				<uri>http://phpforums.org/user27.html</uri>
			</author>
			<updated>2010-07-01T22:33:01Z</updated>
			<id>http://phpforums.org/topic27-date-n-time-new-posts.html</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Effective Way To Get Links From Forums]]></title>
			<link rel="alternate" href="http://phpforums.org/topic31-effective-way-to-get-links-from-forums-new-posts.html"/>
			<summary type="html"><![CDATA[<p>Forum is the panel for discussing our thoughts or ideas and sharing knowledgeable information. People who uses discussion forums knew that they should use a signature to promote their site, and if you have placed your signature then it will help you in getting more <a href="http://seo-links.us">backlinks </a>and traffic form the forum website.</p><p>If you participate in more number of discussions, then more number of people will see to your signature and will click on the link to your website. Let me share some tips regarding <a href="http://seo-links.us">forum signature</a>. </p><p>Do’s</p><p>#&nbsp; &nbsp; First, remember that you must add or create a signature that follows all the guidelines and rules of that forum </p><p>#&nbsp; &nbsp; When you start add your signature. Your signature should say a little bit about your website and then a link to your website.</p><p>#&nbsp; &nbsp; The forum signatures can be a keyword that we are targeting for the particular websites that helps to increase the traffic for that keyword </p><p>#&nbsp; &nbsp; If you are posting in particular forum,that allows you to add colors for signature links then do it. Because colors is one of the way to attract visitors.</p><p>#&nbsp; &nbsp; <a href="http://seo-links.us">Forum signature</a> with caps will grab attention of users.</p><p>#&nbsp; &nbsp; According to the forum guidelines and rules,you should know how many characters and signature links can be added and what is acceptable and what is considered as spam</p><p>#&nbsp; &nbsp; Participating in popular forums there may be the chance of more members will visit your website. So,take advantage of this fact by making the post of your signature links.</p><p>#&nbsp; &nbsp; Another one important point is your <a href="http://seo-links.us">signature link</a> should be attractive,original and interesting. People will visit your site if you have attractive signature and it is similar to creating an effective <a href="http://seo-links.us">blog post</a> titles.<br />Dont’s </p><p>#&nbsp; &nbsp; If you are going to participate newly in particular forum don’t add signature immediately. <a href="http://seo-links.us">Add signature</a> after making 10 to 50 posts as per the rules.</p><p>#&nbsp; &nbsp; Do not use any words that <a href="http://seo-links.us">promote your own website</a> while answering other members question. Answer the question if you know about the subject and if your answers are good,people will visit your website through signature link.</p><p>#&nbsp; &nbsp; Don’t post in old threads because sometimes you may get banned in some forums. Post in recent threads that helps the members and also you can gain more traffic.</p><p>#&nbsp; &nbsp; Don’t post the answers which is irrelevant to thread.<br />Now a days forum topics are becoming endless and also the great fact is that they are good for advertising our website or products by adding your signature. So make your signature the most effective and attractive, and I hope this tips will help you.Even though your signature is bright and effective it is not enough, your active participation plays a mighty role in forums. All the best.</p><p>__________________<br /><a href="http://www.seo-links.us">http://www.seo-links.us</a><br /><a href="http://seo-links.us">Forums Posting Service</a><br /><a href="http://seo-links.us">Forum link building</a></p>]]></summary>
			<author>
				<name><![CDATA[brownronaldo]]></name>
				<uri>http://phpforums.org/user39.html</uri>
			</author>
			<updated>2010-06-26T07:36:30Z</updated>
			<id>http://phpforums.org/topic31-effective-way-to-get-links-from-forums-new-posts.html</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Effective Way To Get Links From Forums]]></title>
			<link rel="alternate" href="http://phpforums.org/topic30-effective-way-to-get-links-from-forums-new-posts.html"/>
			<summary type="html"><![CDATA[<p>Forum is the panel for discussing our thoughts or ideas and sharing knowledgeable information. People who uses discussion forums knew that they should use a signature to promote their site, and if you have placed your signature then it will help you in getting more <a href="http://seo-links.us">backlinks </a>and traffic form the forum website.</p><p>If you participate in more number of discussions, then more number of people will see to your signature and will click on the link to your website. Let me share some tips regarding <a href="http://seo-links.us">forum signature</a>. </p><p>Do’s</p><p>#&nbsp; &nbsp; First, remember that you must add or create a signature that follows all the guidelines and rules of that forum </p><p>#&nbsp; &nbsp; When you start add your signature. Your signature should say a little bit about your website and then a link to your website.</p><p>#&nbsp; &nbsp; The forum signatures can be a keyword that we are targeting for the particular websites that helps to increase the traffic for that keyword </p><p>#&nbsp; &nbsp; If you are posting in particular forum,that allows you to add colors for signature links then do it. Because colors is one of the way to attract visitors.</p><p>#&nbsp; &nbsp; <a href="http://seo-links.us">Forum signature</a> with caps will grab attention of users.</p><p>#&nbsp; &nbsp; According to the forum guidelines and rules,you should know how many characters and signature links can be added and what is acceptable and what is considered as spam</p><p>#&nbsp; &nbsp; Participating in popular forums there may be the chance of more members will visit your website. So,take advantage of this fact by making the post of your signature links.</p><p>#&nbsp; &nbsp; Another one important point is your <a href="http://seo-links.us">signature link</a> should be attractive,original and interesting. People will visit your site if you have attractive signature and it is similar to creating an effective <a href="http://seo-links.us">blog post</a> titles.<br />Dont’s </p><p>#&nbsp; &nbsp; If you are going to participate newly in particular forum don’t add signature immediately. <a href="http://seo-links.us">Add signature</a> after making 10 to 50 posts as per the rules.</p><p>#&nbsp; &nbsp; Do not use any words that <a href="http://seo-links.us">promote your own website</a> while answering other members question. Answer the question if you know about the subject and if your answers are good,people will visit your website through signature link.</p><p>#&nbsp; &nbsp; Don’t post in old threads because sometimes you may get banned in some forums. Post in recent threads that helps the members and also you can gain more traffic.</p><p>#&nbsp; &nbsp; Don’t post the answers which is irrelevant to thread.<br />Now a days forum topics are becoming endless and also the great fact is that they are good for advertising our website or products by adding your signature. So make your signature the most effective and attractive, and I hope this tips will help you.Even though your signature is bright and effective it is not enough, your active participation plays a mighty role in forums. All the best.</p><p>__________________<br /><a href="http://www.seo-links.us">http://www.seo-links.us</a><br /><a href="http://seo-links.us">Forums Posting Service</a><br /><a href="http://seo-links.us">Forum link building</a></p>]]></summary>
			<author>
				<name><![CDATA[smookedtrout]]></name>
				<uri>http://phpforums.org/user38.html</uri>
			</author>
			<updated>2010-06-25T06:54:27Z</updated>
			<id>http://phpforums.org/topic30-effective-way-to-get-links-from-forums-new-posts.html</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[PHP script to select state]]></title>
			<link rel="alternate" href="http://phpforums.org/topic29-php-script-to-select-state-new-posts.html"/>
			<summary type="html"><![CDATA[<p>I have a database table called contacts with a table in it called addresses. The fields in the addresses table are firstname, lastname, address, city, state, zip, areacode and phonenumber. (The state field is a 2 character text field.) I want to ask the user for a state and then I want to display all the records for that state only. Can anyone help me? </p><p>Thanks, </p><p>Andrew</p>]]></summary>
			<author>
				<name><![CDATA[andrewgrz]]></name>
				<uri>http://phpforums.org/user36.html</uri>
			</author>
			<updated>2010-06-12T03:26:22Z</updated>
			<id>http://phpforums.org/topic29-php-script-to-select-state-new-posts.html</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Comma delimited file]]></title>
			<link rel="alternate" href="http://phpforums.org/topic28-comma-delimited-file-new-posts.html"/>
			<summary type="html"><![CDATA[<p>I have a comma delimited text file with several records. A typical record looks like this:</p><p>Jim,Smith,1234 Main Street,Anytown,NY,12345,206,123-3456</p><p>I need to read the file andd then output the data (name and phone number) in a two columm table like this:</p><p>Smith, Jim&nbsp; &nbsp; &nbsp; &nbsp; (206) 123-3456</p><p>The data also needs to be sorted by last name.</p><p>I assume I will be using an array, but I&#039;m not sure how to do it.</p><p>If you can help me, email me at grz@wi-net.com.</p><p>Thanks,</p><p>Andrew</p>]]></summary>
			<author>
				<name><![CDATA[andrewgrz]]></name>
				<uri>http://phpforums.org/user36.html</uri>
			</author>
			<updated>2010-06-06T02:00:09Z</updated>
			<id>http://phpforums.org/topic28-comma-delimited-file-new-posts.html</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[hi]]></title>
			<link rel="alternate" href="http://phpforums.org/topic26-hi-new-posts.html"/>
			<summary type="html"><![CDATA[<p>glad to join this forum <img src="http://phpforums.org/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></summary>
			<author>
				<name><![CDATA[tim]]></name>
				<uri>http://phpforums.org/user27.html</uri>
			</author>
			<updated>2010-03-31T20:40:04Z</updated>
			<id>http://phpforums.org/topic26-hi-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[hi :)]]></title>
			<link rel="alternate" href="http://phpforums.org/topic25-hi-new-posts.html"/>
			<summary type="html"><![CDATA[<div class="codebox"><pre><code>&lt;?php echo &quot;hi everyone&quot;; ?&gt;</code></pre></div>]]></summary>
			<author>
				<name><![CDATA[jaydesigns]]></name>
				<uri>http://phpforums.org/user18.html</uri>
			</author>
			<updated>2009-11-28T03:58:50Z</updated>
			<id>http://phpforums.org/topic25-hi-new-posts.html</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Hi ya]]></title>
			<link rel="alternate" href="http://phpforums.org/topic22-hi-ya-new-posts.html"/>
			<summary type="html"><![CDATA[<p>Just a quick message to say hello to everyone here on the forum.&nbsp; Folks call me Orry, which comes from the mini-series North and South.&nbsp; I love forward to learning and sharing with y&#039;all.</p>]]></summary>
			<author>
				<name><![CDATA[jaydesigns]]></name>
				<uri>http://phpforums.org/user16.html</uri>
			</author>
			<updated>2009-11-21T04:04:19Z</updated>
			<id>http://phpforums.org/topic22-hi-ya-new-posts.html</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[For beginners, where to learn?]]></title>
			<link rel="alternate" href="http://phpforums.org/topic24-for-beginners-where-to-learn-new-posts.html"/>
			<summary type="html"><![CDATA[<p>For all the beginners, where is the best place to learn about coding and, for that matter, anything related to getting started?</p>]]></summary>
			<author>
				<name><![CDATA[jaydesigns]]></name>
				<uri>http://phpforums.org/user16.html</uri>
			</author>
			<updated>2009-11-21T04:03:09Z</updated>
			<id>http://phpforums.org/topic24-for-beginners-where-to-learn-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[How Long on the Internet]]></title>
			<link rel="alternate" href="http://phpforums.org/topic23-how-long-on-the-internet-new-posts.html"/>
			<summary type="html"><![CDATA[<p>I was just curious how long everyone has been on the internet, or just online for that matter?&nbsp; I got online in the early to mid-90&#039;s before the internet was booming.</p>]]></summary>
			<author>
				<name><![CDATA[Orrymain]]></name>
				<uri>http://phpforums.org/user16.html</uri>
			</author>
			<updated>2009-11-18T22:08:03Z</updated>
			<id>http://phpforums.org/topic23-how-long-on-the-internet-new-posts.html</id>
		</entry>
</feed>
