<?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>miligraf.com &#187; PHP Tutorials</title>
	<atom:link href="http://www.miligraf.com/category/php-tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.miligraf.com</link>
	<description>Graphic and Web Design</description>
	<lastBuildDate>Sat, 26 Sep 2009 21:18:23 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Page title changer</title>
		<link>http://www.miligraf.com/php-tutorials/page-title-changer/</link>
		<comments>http://www.miligraf.com/php-tutorials/page-title-changer/#comments</comments>
		<pubDate>Sun, 17 Aug 2008 22:34:25 +0000</pubDate>
		<dc:creator>miligraf</dc:creator>
				<category><![CDATA[PHP Tutorials]]></category>

		<guid isPermaLink="false">http://www.miligraf.com/?p=59</guid>
		<description><![CDATA[Have you ever wondered how sites (like this one) have a different page title for each page?
Here is how you do it:
Lets say you have 3 pages: index.php, about.php and contact.php. You need to have the page include system working so we can use the same variable for the page title changer.

&#60; !DOCTYPE html PUBLIC [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Have you ever wondered how sites (like this one) have a different page title for each page?</p>
<p>Here is how you do it:</p>
<p>Lets say you have 3 pages: index.php, about.php and contact.php. You need to have the page include system working so we can use the same variable for the page title changer.</p>
<pre class="brush: php">
&lt; !DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;title&gt;My website &gt; &lt; ? 	$page=$_GET[&#039;page&#039;]; //page title changer
						if ($page==&quot;about&quot;){ //if the page you are viewing is about.php it shows &quot;About me&quot; text in the page title
							echo &quot;About me&quot;; //shows &quot;About me&quot; text on page title
						}elseif($page==&quot;contact&quot;){ //same as above but with contact.php
							echo &quot;Contact me&quot;; //same as above but with &quot;Contact me&quot; text on page title
						}else{
							echo &quot;Home&quot;; //shows &quot;Home&quot; text on page title
						}
					?&gt;&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;a href=&quot;http://www.mywebsite.com&quot;&gt;home&lt;/a&gt; &lt;!-- Menu link --&gt;
&lt;a href=&quot;?page=about&quot;&gt;about me&lt;/a&gt; &lt;!-- Menu link for about page --&gt;
&lt;a href=&quot;?page=contact&quot;&gt;contact me&lt;/a&gt; &lt;!-- Menu link for contact page--&gt;
&lt; ? 	$page=$_GET[&#039;page&#039;]; //include system. loads the file when you click the link
	if ($page==&quot;about&quot;){ //if you click the about link it will load about.php
		include(&#039;about.php&#039;); //it loads about.php inside the index.php
	}elseif($page==&quot;contact&quot;){ //same as above but with contact
		include(&#039;contact&#039;); //same as above but with contact.php
	}else{
		include(&#039;home.php&#039;); //loads home.php if no link is clicked or if did not find any of the links/files above
	}
?&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.miligraf.com/php-tutorials/page-title-changer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Page include system for newbies</title>
		<link>http://www.miligraf.com/php-tutorials/navigation-for-newbies/</link>
		<comments>http://www.miligraf.com/php-tutorials/navigation-for-newbies/#comments</comments>
		<pubDate>Sun, 17 Aug 2008 21:57:58 +0000</pubDate>
		<dc:creator>miligraf</dc:creator>
				<category><![CDATA[PHP Tutorials]]></category>

		<guid isPermaLink="false">http://www.miligraf.com/?p=56</guid>
		<description><![CDATA[This system pretends to have one file (index.php) and run the others (about.php, contact.php, ect.) inside of it
I read a lot of tutorials but later on, when my site had months running, i found about the PHP Switch Statement and this is the easiest way to have your PHP Navigation.
Copy and paste the code, you [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>This system pretends to have one file (index.php) and run the others (about.php, contact.php, ect.) inside of it</p>
<p>I read a lot of tutorials but later on, when my site had months running, i found about the PHP Switch Statement and this is the easiest way to have your PHP Navigation.</p>
<p>Copy and paste the code, you will find the explanaition in it.</p>
<pre class="brush: php">
&lt; ?php
//First of all, let me tell you that you need to have a file with this code placed where you want the files to load and that if you include anyother file in the ones you are calling, you have to include them as if they were in the main folder.
//You can change $navigation to anything you want, like $page or $section but remember to change the 3 &quot;navigation&quot; words to your new one.
$navigation=$_GET[&#039;navigation&#039;];
switch ($navigation) {

//You have to use it like this, when the file is in the same folder with the index. You can put any name in case and have the file in any folder at your site. http://www.yoursite.com/?navigation=section1
case &quot;section1&quot;:
include(&#039;section1_file.php&#039;);
break;

//Another example, the file is in a subfolder but people wont know it, they will only see http://www.yoursite.com/?navigation=section2
case &quot;section2&quot;:
include(&#039;section/section2_file.php&#039;);
break;

//As you can see in this last example, you can have your file in any place and put any name in your &quot;case&quot;. http://www.yoursite.com/?navigation=lastsection
case &quot;lastsection&quot;:
include(&#039;folder1/folder2/section3.php&#039;);
break;

//This will be your index or default page you want to show when people has just landed on your site and this will be the page it will show when people try to access any page that you havent declared here.
default:
include(&#039;home.php&#039;);

}
?&gt;
</pre>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.miligraf.com/php-tutorials/navigation-for-newbies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mail form for newbies</title>
		<link>http://www.miligraf.com/php-tutorials/mail-form-for-newbies/</link>
		<comments>http://www.miligraf.com/php-tutorials/mail-form-for-newbies/#comments</comments>
		<pubDate>Sun, 17 Aug 2008 21:38:56 +0000</pubDate>
		<dc:creator>miligraf</dc:creator>
				<category><![CDATA[PHP Tutorials]]></category>

		<guid isPermaLink="false">http://www.miligraf.com/?p=44</guid>
		<description><![CDATA[When i started my site i read a lot of tutorials looking for the best email form, but my problem was that i was a PHP newbie, in other words, i didnt know ANYTHING about PHP so it was really hard to understand the tutorials even if they tried to explain it.
So let me explain [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>When i started my site i read a lot of tutorials looking for the best email form, but my problem was that i was a PHP newbie, in other words, i didnt know ANYTHING about PHP so it was really hard to understand the tutorials even if they tried to explain it.</p>
<p>So let me explain it to you as i would have liked that someone explained it to me.</p>
<p>If you are a copy-paste kind of guy, then just copy the PHP code below, in it there are the explanaition of each thing you need to know.</p>
<pre class="brush: php">//sendemail is our button name, and if it is clicked, we will run this PHP code
if($_POST[&#039;sendemail&#039;]){
//do you remember all those name=&quot;something&quot; and id=&quot;something&quot; that we had to use before? then, here is why
//it will get all those variables (text typed in the fields) and use them for the email
$name =&quot;$name&quot;;
$email=&quot;$email&quot;;
//lets say you want a default subject, then just change $subject=&quot;$subject&quot;; to $subject=&quot;Default Subject&quot;;
$subject=&quot;$subject&quot;;
//or maybe you want a default message, than just do the same as before.
$body=&quot;$message&quot;;
$header=&quot;from: $name &lt; $email&gt;&quot;;
//if you want the email to be sent to other people, then just add them seperated by a comma (,)
$for =&#039;miligraf@miligraf.com&#039;;
//this is how it works mail(receiver&#039;s email, the email&#039;s subject, the email&#039;s message, name and email that was typed in the form)
$send=mail($for,$subject,$body,$header);
if($send){
echo &quot;The email has been sent, thanks for contacting me.&quot;;
}else{
echo &quot;The email could not be sent, try later.&quot;;
}
}else{?&gt;
&lt;!-- Comments in HTML go grey <img src='http://www.miligraf.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  --&gt;
&lt;!-- since we are in a new era we wont use any tables, instead we will have some div&#039;s to tell them where to go --&gt;

&lt;form method=&quot;post&quot;&gt; &lt;!-- your first field, Name, you will need it if you want to have the sender&#039;s Name or you can have a default Name made by you but i will let you know where to put it later --&gt;
&lt;!-- remember that the values of name and id must be name, like this name=&quot;name&quot; id=&quot;name&quot; --&gt;
Name:
&lt;div&gt;&lt;input id=&quot;name&quot; name=&quot;name&quot; size=&quot;40&quot; type=&quot;text&quot; /&gt;&lt;/div&gt;
&lt;!-- remember that the values of name and id must be subject, like this name=&quot;subject&quot; id=&quot;subject&quot; --&gt;
Subject:
&lt;div&gt;&lt;input id=&quot;subject&quot; name=&quot;subject&quot; size=&quot;40&quot; type=&quot;text&quot; /&gt;&lt;/div&gt;
&lt;!-- remember that the values of name and id must be email, like this name=&quot;email&quot; id=&quot;email&quot; --&gt;
E-mail:
&lt;div&gt;&lt;input id=&quot;email&quot; name=&quot;email&quot; size=&quot;40&quot; type=&quot;text&quot; /&gt;&lt;/div&gt;
&lt;!-- remember that the values of name and id must be message, like this name=&quot;message&quot; id=&quot;message&quot; --&gt;
Message:
&lt;div&gt;&lt;textarea id=&quot;message&quot; cols=&quot;40&quot; rows=&quot;10&quot; name=&quot;message&quot;&gt;&lt;/textarea&gt;&lt;/div&gt;
&lt;div&gt;&lt;!-- this is the button and we give it a name that we will use in the next part --&gt;

&lt;input name=&quot;sendemail&quot; type=&quot;submit&quot; value=&quot;Send&quot; /&gt;&lt;/div&gt;
&lt;/form&gt;</pre>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.miligraf.com/php-tutorials/mail-form-for-newbies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
