<?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>Tutorials Palace &#187; admin</title>
	<atom:link href="http://www.tutorialspalace.com/author/admin/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tutorialspalace.com</link>
	<description></description>
	<lastBuildDate>Fri, 03 Feb 2012 14:23:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Image of the Day PHP Tutorial</title>
		<link>http://www.tutorialspalace.com/2011/08/image-of-the-day-php-tutorial/</link>
		<comments>http://www.tutorialspalace.com/2011/08/image-of-the-day-php-tutorial/#comments</comments>
		<pubDate>Tue, 16 Aug 2011 08:20:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Change Image Tutorial]]></category>
		<category><![CDATA[Daily Image Tutorial]]></category>
		<category><![CDATA[Random Image Tutorial]]></category>

		<guid isPermaLink="false">http://www.tutorialspalace.com/?p=2811</guid>
		<description><![CDATA[In this tutorial shows you how to display image of the day. You can adapt this script to display quote of the day, knowledge of the day or something else you want. You don&#8217;t have to change image everyday just change images once a week.&#160; &#160; What to do? 1. Find what today is? using [...]]]></description>
			<content:encoded><![CDATA[<p>In this tutorial shows you how to display image of the day. You can adapt this script to display quote of the day, knowledge of the day or something else you want. You don&#8217;t have to change image everyday just change images once a week.&nbsp; </p>
<table border="0" cellpadding="6" cellspacing="0" width="450">
<tbody>
<tr>
<td><img src="http://www.tutorialspalace.com/wp-content/uploads/2010/04/image1.gif" height="110" width="100" title="Image of the Day PHP Tutorial" alt="image1 Image of the Day PHP Tutorial" /></td>
<td><img src="http://www.tutorialspalace.com/wp-content/uploads/2010/04/image2.gif" height="110" width="100" title="Image of the Day PHP Tutorial" alt="image2 Image of the Day PHP Tutorial" /></td>
<td><img src="http://www.tutorialspalace.com/wp-content/uploads/2010/04/image3.gif" height="110" width="100" title="Image of the Day PHP Tutorial" alt="image3 Image of the Day PHP Tutorial" /></td>
<td><img src="http://www.tutorialspalace.com/wp-content/uploads/2010/04/image4.gif" height="110" width="100" title="Image of the Day PHP Tutorial" alt="image4 Image of the Day PHP Tutorial" /></td>
</tr>
<tr>
<td><img src="http://www.tutorialspalace.com/wp-content/uploads/2010/04/image5.gif" height="110" width="100" title="Image of the Day PHP Tutorial" alt="image5 Image of the Day PHP Tutorial" /></td>
<td><img src="http://www.tutorialspalace.com/wp-content/uploads/2010/04/image6.gif" height="110" width="100" title="Image of the Day PHP Tutorial" alt="image6 Image of the Day PHP Tutorial" /></td>
<td><img src="http://www.tutorialspalace.com/wp-content/uploads/2010/04/image7.gif" height="110" width="100" title="Image of the Day PHP Tutorial" alt="image7 Image of the Day PHP Tutorial" /></td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
<p><strong>What to do?</strong></p>
<p>1. Find what today is? using date function and keep answer in variable name &#8220;$today&#8221;.<br />
  2. Compare $today with name of the day. <br />
  3. Display &#8220;Today is &#8221; &#8230; &#8221; and display image of the day. <br />
  4. test it. Try to change your machine date and see the result! </p>
<p>$today=date(l); // Find what today is? using date function</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
</pre>
<pre>&lt;p&gt;// If today is Monday displays message &quot;Today is Monday&quot; and displays image1.gif&lt;br&gt;
if($today==Monday){// Compare $today with name of the day.&lt;br&gt;
echo &quot;Today is Monday&quot;;&lt;br&gt;
echo &quot;&lt;BR&gt;&quot;; // Line break &lt;br&gt;
echo &quot;&lt;img src=&#039;images/image1.gif&#039;&gt;&quot;; // images keep in forder &quot;images&quot; &lt;br&gt;
}&lt;/p&gt;</pre>
</div>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>If You want to show 1 month 31 images replace with this code</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
</pre>
<pre>$today=date(d); // display date &quot;01&quot;, &quot;02&quot;, &quot;03&quot;...&quot;15&quot;, &quot;16&quot; ....&lt;br&gt;
if($today==01){ .......&lt;br&gt;
&lt;br&gt;
elseif($today==15){ .......&lt;/p&gt;
&lt;p&gt;until $today==31 &lt;/p&gt;</pre>
</div>
<p><strong>|&#8212;|&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; code &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;|&#8212;|</strong></p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
</pre>
<pre>&lt;p&gt;&lt;?&lt;br&gt;
$today=date(l);// Find what today is? using date function&lt;/p&gt;
&lt;p&gt;if($today==Monday){&lt;br&gt;
  echo &quot;Today is Monday&quot;;&lt;br&gt;
  echo &quot;&lt;BR&gt;&quot;;&lt;br&gt;
  echo &quot;&lt;img src=&#039;images/image1.gif&#039;&gt;&quot;;&lt;br&gt;
  }&lt;br&gt;
  &lt;br&gt;
  elseif($today==Tuesday){&lt;br&gt;
  echo &quot;Today is Tuesday&quot;;&lt;br&gt;
  echo &quot;&lt;BR&gt;&quot;;&lt;br&gt;
  echo &quot;&lt;img src=&#039;images/image2.gif&#039;&gt;&quot;;&lt;br&gt;
  }&lt;br&gt;
  &lt;br&gt;
  elseif($today==Wednesday){&lt;br&gt;
  echo &quot;Today is Wednesday&quot;;&lt;br&gt;
  echo &quot;&lt;BR&gt;&quot;;&lt;br&gt;
  echo &quot;&lt;img src=&#039;images/image3.gif&#039;&gt;&quot;;&lt;br&gt;
  }&lt;br&gt;
  &lt;br&gt;
  elseif($today==Thursday){&lt;br&gt;
  echo &quot;Today is Thursday&quot;;&lt;br&gt;
  echo &quot;&lt;BR&gt;&quot;;&lt;br&gt;
  echo &quot;&lt;img src=&#039;images/image4.gif&#039;&gt;&quot;;&lt;br&gt;
  }&lt;br&gt;
  &lt;br&gt;
  elseif($today==Friday){&lt;br&gt;
  echo &quot;Today is Friday&quot;;&lt;br&gt;
  echo &quot;&lt;BR&gt;&quot;;&lt;br&gt;
  echo &quot;&lt;img src=&#039;images/image5.gif&#039;&gt;&quot;;&lt;br&gt;
  }&lt;br&gt;
  &lt;br&gt;
  elseif($today==Saturday){&lt;br&gt;
  echo &quot;Today is Saturday&quot;;&lt;br&gt;
  echo &quot;&lt;BR&gt;&quot;;&lt;br&gt;
  echo &quot;&lt;img src=&#039;images/image6.gif&#039;&gt;&quot;;&lt;br&gt;
  }&lt;br&gt;
  &lt;br&gt;
  elseif($today==Sunday){&lt;br&gt;
  echo &quot;Today is Sunday&quot;;&lt;br&gt;
  echo &quot;&lt;BR&gt;&quot;;&lt;br&gt;
  echo &quot;&lt;img src=&#039;images/image7.gif&#039;&gt;&quot;;&lt;br&gt;
  }&lt;br&gt;
  &lt;br&gt;
  ?&gt;&lt;/p&gt;</pre>
</div>
<h2  class="related_post_title">Random Posts</h2><ul class="related_post"><li><a href="http://www.tutorialspalace.com/2011/03/adobe-illustrator-video-tutorials-collection/" title="Adobe Illustrator Video Tutorials Collection"><img src="http://www.tutorialspalace.com/wp-content/uploads/2011/02/adobe-illustrator.jpg" alt="adobe illustrator Image of the Day PHP Tutorial"  title="Image of the Day PHP Tutorial" /></a><a href="http://www.tutorialspalace.com/2011/03/adobe-illustrator-video-tutorials-collection/" title="Adobe Illustrator Video Tutorials Collection">Adobe Illustrator Video Tutorials Collection</a></li><li><a href="http://www.tutorialspalace.com/2011/08/awesome-collection-of-screen-printing-tutorials/" title="Awesome Collection of Screen Printing Tutorials"><img src="http://www.tutorialspalace.com/wp-content/uploads/2011/08/awesome-screen-printing-tuts.jpg" alt="awesome screen printing tuts Image of the Day PHP Tutorial"  title="Image of the Day PHP Tutorial" /></a><a href="http://www.tutorialspalace.com/2011/08/awesome-collection-of-screen-printing-tutorials/" title="Awesome Collection of Screen Printing Tutorials">Awesome Collection of Screen Printing Tutorials</a></li><li><a href="http://www.tutorialspalace.com/2011/02/15-website-design-converting-psd-to-htmlcss-tutorials/" title="15+ Website Design Converting PSD to HTML/CSS Tutorials"><img src="http://www.tutorialspalace.com/wp-content/uploads/2011/01/psd-to-html-heading.jpg" alt="psd to html heading Image of the Day PHP Tutorial"  title="Image of the Day PHP Tutorial" /></a><a href="http://www.tutorialspalace.com/2011/02/15-website-design-converting-psd-to-htmlcss-tutorials/" title="15+ Website Design Converting PSD to HTML/CSS Tutorials">15+ Website Design Converting PSD to HTML/CSS Tutorials</a></li><li><a href="http://www.tutorialspalace.com/2012/01/35-unbelievable-advertisement-and-poster-tutorials/" title="35+ Unbelievable Advertisement and Poster Tutorials"><img src="http://www.tutorialspalace.com/wp-content/uploads/2012/01/unbelievable-ads-poster-tuts.jpg" alt="unbelievable ads poster tuts Image of the Day PHP Tutorial"  title="Image of the Day PHP Tutorial" /></a><a href="http://www.tutorialspalace.com/2012/01/35-unbelievable-advertisement-and-poster-tutorials/" title="35+ Unbelievable Advertisement and Poster Tutorials">35+ Unbelievable Advertisement and Poster Tutorials</a></li><li><a href="http://www.tutorialspalace.com/2011/02/40-outstanding-adobe-illustrator-cartoon-tutorials/" title="40+ Outstanding Adobe Illustrator Cartoon Tutorials "><img src="http://www.tutorialspalace.com/wp-content/uploads/2010/03/cart-tuts-40-head.jpg" alt="cart tuts 40 head Image of the Day PHP Tutorial"  title="Image of the Day PHP Tutorial" /></a><a href="http://www.tutorialspalace.com/2011/02/40-outstanding-adobe-illustrator-cartoon-tutorials/" title="40+ Outstanding Adobe Illustrator Cartoon Tutorials ">40+ Outstanding Adobe Illustrator Cartoon Tutorials </a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.tutorialspalace.com/2011/08/image-of-the-day-php-tutorial/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Limit Displayed Characters From Your Text</title>
		<link>http://www.tutorialspalace.com/2011/06/limit-displayed-characters-from-your-text/</link>
		<comments>http://www.tutorialspalace.com/2011/06/limit-displayed-characters-from-your-text/#comments</comments>
		<pubDate>Thu, 09 Jun 2011 08:10:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Limited Characters Tutorial]]></category>
		<category><![CDATA[PHP Text Tutorial]]></category>

		<guid isPermaLink="false">http://www.tutorialspalace.com/?p=2807</guid>
		<description><![CDATA[This php tutorial will help you that how will apply limit displaying characters form you message and not cut out your word. Syntax substr($message, start, length); Example 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 [...]]]></description>
			<content:encoded><![CDATA[<p>This php tutorial will help you that how will apply limit displaying characters form you message and not cut out your word.</p>
<p><span id="more-2807"></span></p>
<p><strong>Syntax</strong></p>
<p><strong> </strong>substr($message, start, length); </p>
<h2>Example 1 </h2>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
</pre>
<pre>&lt;p&gt;&lt;?&lt;br&gt;
  &lt;br&gt;
$position=14; // Define here that how many character you want to display there.&lt;br&gt;
&lt;br&gt;
$message=&quot;You are now joining over 2000 current&quot;; &lt;br&gt;
$post = substr($message, 0, $position); &lt;br&gt;
&lt;br&gt;
echo $post;&lt;br&gt;
echo &quot;...&quot;; &lt;br&gt;
&lt;br&gt;
?&gt;&lt;/p&gt;
&lt;p&gt;This result shows 14 characters from your message&lt;br&gt;
  &lt;br&gt;
  &lt;strong&gt;&quot;Limit Display...&quot; &lt;/strong&gt;&lt;br&gt;</pre>
</div>
<p>
  This is not good. We want to display <strong>&#8220;Limit Displayed Characters&#8230;&#8221;</strong>  Let&#8217;s solve this problem in example 2.</p>
<h2>Example 2</h2>
<p>1. Define how many characters you want to display.<br />
  2. Find what is the last character displaying.<br />
  3. If the last character displaying is not &#8221; &#8221; (space) then go to next character until we found it.<br />
  4. Display your message.</p>
<p><strong>|&#8212;|&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; code &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;|&#8212;|</strong></p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
</pre>
<pre>&lt;p&gt;&lt;?&lt;br&gt;
  $position=14; // Define here that how many character you want to display there.&lt;br&gt;
  &lt;br&gt;
  $message=&quot;You are now joining over 2000 current&quot;;&lt;br&gt;
  $post = substr($message,$position,1); // Find what is the last character displaying. We find it by getting only last one character from your display message.&lt;/p&gt;
&lt;p&gt;if($post !=&quot; &quot;){ // In this step, if last character is not &quot; &quot;(space) do this step.&lt;/p&gt;
&lt;p&gt;// Find until we found that last character is &quot; &quot;(space)&lt;br&gt;
// by $position+1 (14+1=15, 15+1=16 until we found &quot; &quot;(space) that mean character 20)&lt;br&gt;
  while($post !=&quot; &quot;){&lt;br&gt;
  $i=1;&lt;br&gt;
$position=$position+$i;&lt;/p&gt;
&lt;p&gt;$message=&quot;You are now joining over 2000 current&quot;;&lt;br&gt;
  $post = substr($message,$position,1);&lt;br&gt;
}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;$post = substr($message,0,$position); // Display your message here&lt;br&gt;
  echo $post;&lt;br&gt;
  echo &quot;...&quot;;&lt;br&gt;
?&gt;&lt;/p&gt;</pre>
</div>
<h2  class="related_post_title">Random Posts</h2><ul class="related_post"><li><a href="http://www.tutorialspalace.com/2011/09/how-to-create-professional-business-cards-designs/" title="How to Create Professional Business Cards Designs"><img src="http://www.tutorialspalace.com/wp-content/uploads/2011/09/create-professional-business-cards.jpg" alt="create professional business cards Limit Displayed Characters From Your Text"  title="Limit Displayed Characters From Your Text" /></a><a href="http://www.tutorialspalace.com/2011/09/how-to-create-professional-business-cards-designs/" title="How to Create Professional Business Cards Designs">How to Create Professional Business Cards Designs</a></li><li><a href="http://www.tutorialspalace.com/2011/04/wallpapers-tutorials-of-create-marry-christmas-using-photoshop/" title="Wallpapers Tutorials of Create Marry Christmas Using Photoshop"><img src="http://www.tutorialspalace.com/wp-content/uploads/2011/04/xmas-wallpapers-tuts.jpg" alt="xmas wallpapers tuts Limit Displayed Characters From Your Text"  title="Limit Displayed Characters From Your Text" /></a><a href="http://www.tutorialspalace.com/2011/04/wallpapers-tutorials-of-create-marry-christmas-using-photoshop/" title="Wallpapers Tutorials of Create Marry Christmas Using Photoshop">Wallpapers Tutorials of Create Marry Christmas Using Photoshop</a></li><li><a href="http://www.tutorialspalace.com/2010/11/65-ultimate-round-up-of-illustrator-tutorials/" title="65 Ultimate Round-Up of Illustrator Tutorials"><img src="http://www.tutorialspalace.com/wp-content/uploads/2010/02/tuts-illustrator65-head.jpg" alt="tuts illustrator65 head Limit Displayed Characters From Your Text"  title="Limit Displayed Characters From Your Text" /></a><a href="http://www.tutorialspalace.com/2010/11/65-ultimate-round-up-of-illustrator-tutorials/" title="65 Ultimate Round-Up of Illustrator Tutorials">65 Ultimate Round-Up of Illustrator Tutorials</a></li><li><a href="http://www.tutorialspalace.com/2011/06/animations-and-drawing-tutorials-of-adobe-flash/" title="Animations and Drawing Tutorials of Adobe Flash"><img src="http://www.tutorialspalace.com/wp-content/uploads/2011/06/drawing-animations-flash-tutorials.jpg" alt="drawing animations flash tutorials Limit Displayed Characters From Your Text"  title="Limit Displayed Characters From Your Text" /></a><a href="http://www.tutorialspalace.com/2011/06/animations-and-drawing-tutorials-of-adobe-flash/" title="Animations and Drawing Tutorials of Adobe Flash">Animations and Drawing Tutorials of Adobe Flash</a></li><li><a href="http://www.tutorialspalace.com/2009/12/70-mind-blowing-digital-painting-tutorials/" title="70+ Mind-Blowing Digital Painting Tutorials"><img src="http://www.tutorialspalace.com/wp-content/uploads/2009/11/dig-tuts-head70.jpg" alt="dig tuts head70 Limit Displayed Characters From Your Text"  title="Limit Displayed Characters From Your Text" /></a><a href="http://www.tutorialspalace.com/2009/12/70-mind-blowing-digital-painting-tutorials/" title="70+ Mind-Blowing Digital Painting Tutorials">70+ Mind-Blowing Digital Painting Tutorials</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.tutorialspalace.com/2011/06/limit-displayed-characters-from-your-text/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upload and Rename File PHP Tutorial</title>
		<link>http://www.tutorialspalace.com/2011/06/upload-and-rename-file-php-tutorial/</link>
		<comments>http://www.tutorialspalace.com/2011/06/upload-and-rename-file-php-tutorial/#comments</comments>
		<pubDate>Wed, 01 Jun 2011 16:20:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP Tutorial]]></category>
		<category><![CDATA[PHP Upload Rename Tutorial]]></category>
		<category><![CDATA[Upload and Rename File PHP Tutorial]]></category>

		<guid isPermaLink="false">http://www.tutorialspalace.com/?p=2802</guid>
		<description><![CDATA[In this tutorial you will learn that how to rename file when upload file to server to prevent new file overwrite an old file that exists in you server. Overview In this tutorial create 2 files 1. upload_rename.php and 2. upload_rename_ac.php. Steps 1. Create file upload_rename.php. 2. Create file upload_rename_ac.php. 3. Create folder &#8220;upload&#8221; for [...]]]></description>
			<content:encoded><![CDATA[<p>In this tutorial you will learn that how to rename file when upload file to server to prevent new file overwrite an old file that exists in you server.</p>
<p><span id="more-2802"></span></p>
<p>  <strong>Overview</strong></p>
<p>In this tutorial create 2 files 1. upload_rename.php and 2. upload_rename_ac.php.</p>
<p>  Steps<br />
  1. Create file upload_rename.php.<br />
  2. Create file upload_rename_ac.php.<br />
  3. Create folder &#8220;upload&#8221; for store uploaded files.<br />
  4. CHMOD your upload folder to &#8220;777&#8243; by using your ftp software(change permission).</p>
<p>  <strong>Create file upload_rename.php</strong></p>
<p><strong>View in browser</strong></p>
<p>  <img src="http://www.tutorialspalace.com/wp-content/uploads/2010/04/single_file_upload.gif" alt="single file upload Upload and Rename File PHP Tutorial" width="525" height="106" title="Upload and Rename File PHP Tutorial" /></p>
<p><strong>|&#8212;|&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; code &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;|&#8212;|</strong></p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
</pre>
<pre>&lt;p&gt;&lt;table width=&quot;500&quot; border=&quot;0&quot; align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;1&quot; bgcolor=&quot;#CCCCCC&quot;&gt;&lt;br&gt;
&lt;tr&gt;&lt;br&gt;
&lt;form action=&quot;upload_rename_ac.php&quot; method=&quot;post&quot; enctype=&quot;multipart/form-data&quot; name=&quot;form1&quot; id=&quot;form1&quot;&gt;&lt;br&gt;
&lt;td&gt;&lt;br&gt;
&lt;table width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;3&quot; cellspacing=&quot;1&quot; bgcolor=&quot;#FFFFFF&quot;&gt;&lt;br&gt;
&lt;tr&gt;&lt;br&gt;
&lt;td&gt;&lt;strong&gt;Single File Upload &lt;/strong&gt;&lt;/td&gt;&lt;br&gt;
&lt;/tr&gt;&lt;br&gt;
&lt;tr&gt;&lt;br&gt;
&lt;td&gt;Select file &lt;br&gt;
&lt;input name=&quot;ufile&quot; type=&quot;file&quot; id=&quot;ufile&quot; size=&quot;50&quot; /&gt;&lt;/td&gt;&lt;br&gt;
&lt;/tr&gt;&lt;br&gt;
&lt;tr&gt;&lt;br&gt;
&lt;td align=&quot;center&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;Upload&quot; /&gt;&lt;/td&gt;&lt;br&gt;
&lt;/tr&gt;&lt;br&gt;
&lt;/table&gt;&lt;br&gt;
&lt;/td&gt;&lt;br&gt;
&lt;/form&gt;&lt;br&gt;
&lt;/tr&gt;&lt;br&gt;
&lt;/table&gt;&lt;/p&gt;</pre>
</div>
<p><strong>Create file upload_rename_ac.php</strong></p>
<p><strong>|&#8212;|&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; code &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;|&#8212;|</strong></p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
</pre>
<pre>&lt;p&gt;&lt;?php&lt;/p&gt;
&lt;p&gt;// Your file name which you are uploading&lt;br&gt;
  $file_name = $HTTP_POST_FILES[&#039;ufile&#039;][&#039;name&#039;];&lt;/p&gt;
&lt;p&gt;// random 4 digit to add to our file name&lt;br&gt;
  $rand_digit=rand(0000,9999);&lt;br&gt;
  &lt;br&gt;
//combine random digit to create new file name&lt;br&gt;
//use dot (.) to combine these two variables&lt;br&gt;
&lt;br&gt;
  $new_file_name=$rand_digit.$file_name;&lt;/p&gt;
&lt;p&gt;//set where you want to store files&lt;br&gt;
//in this example we keep file in folder upload&lt;br&gt;
//$new_file_name = new upload file name&lt;br&gt;
//for example upload file name newFile.gif . $path will be upload/newFile.gif&lt;br&gt;
  $path= &quot;upload/&quot;.$new_file_name;&lt;br&gt;
  if($ufile !=none)&lt;br&gt;
  {&lt;br&gt;
  if(copy($HTTP_POST_FILES[&#039;ufile&#039;][&#039;tmp_name&#039;], $path))&lt;br&gt;
  {&lt;br&gt;
  echo &quot;Successful&lt;BR/&gt;&quot;;&lt;/p&gt;
&lt;p&gt;//$new_file_name = new file name&lt;br&gt;
//$HTTP_POST_FILES[&#039;ufile&#039;][&#039;size&#039;] = file size&lt;br&gt;
//$HTTP_POST_FILES[&#039;ufile&#039;][&#039;type&#039;] = type of file&lt;br&gt;
  echo &quot;File Name :&quot;.$new_file_name.&quot;&lt;BR/&gt;&quot;;&lt;br&gt;
  echo &quot;File Size :&quot;.$HTTP_POST_FILES[&#039;ufile&#039;][&#039;size&#039;].&quot;&lt;BR/&gt;&quot;;&lt;br&gt;
  echo &quot;File Type :&quot;.$HTTP_POST_FILES[&#039;ufile&#039;][&#039;type&#039;].&quot;&lt;BR/&gt;&quot;;&lt;br&gt;
  }&lt;br&gt;
  else&lt;br&gt;
  {&lt;br&gt;
  echo &quot;Error&quot;;&lt;br&gt;
  }&lt;br&gt;
  }&lt;br&gt;
  ?&gt;&lt;/p&gt;</pre>
</div>
<h2  class="related_post_title">Related Articles</h2><ul class="related_post"><li><a href="http://www.tutorialspalace.com/2011/05/php-encryptions-tutorial/" title="PHP Encryptions Tutorial"><img src="http://www.tutorialspalace.com/wp-content/uploads/2011/05/php-encryption.jpg" alt="php encryption Upload and Rename File PHP Tutorial"  title="Upload and Rename File PHP Tutorial" /></a><a href="http://www.tutorialspalace.com/2011/05/php-encryptions-tutorial/" title="PHP Encryptions Tutorial">PHP Encryptions Tutorial</a></li><li><a href="http://www.tutorialspalace.com/2011/03/alternating-table-row-colors/" title="Alternating Table Row Colors"><img src="http://www.tutorialspalace.com/wp-content/uploads/2010/04/php-alter-tbl-head.jpg" alt="php alter tbl head Upload and Rename File PHP Tutorial"  title="Upload and Rename File PHP Tutorial" /></a><a href="http://www.tutorialspalace.com/2011/03/alternating-table-row-colors/" title="Alternating Table Row Colors">Alternating Table Row Colors</a></li><li><a href="http://www.tutorialspalace.com/2010/04/php-upload-single-file/" title="PHP Upload Single File"><img src="http://www.tutorialspalace.com/wp-content/uploads/2010/04/php-single-fl-up-head.jpg" alt="php single fl up head Upload and Rename File PHP Tutorial"  title="Upload and Rename File PHP Tutorial" /></a><a href="http://www.tutorialspalace.com/2010/04/php-upload-single-file/" title="PHP Upload Single File">PHP Upload Single File</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.tutorialspalace.com/2011/06/upload-and-rename-file-php-tutorial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Alternating Table Row Colors</title>
		<link>http://www.tutorialspalace.com/2011/03/alternating-table-row-colors/</link>
		<comments>http://www.tutorialspalace.com/2011/03/alternating-table-row-colors/#comments</comments>
		<pubDate>Thu, 10 Mar 2011 08:10:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Alternating Table Row Colors]]></category>
		<category><![CDATA[mySQL]]></category>
		<category><![CDATA[PHP Table Row Colors Script]]></category>
		<category><![CDATA[PHP Tutorial]]></category>
		<category><![CDATA[Table Row Colors Tutorial]]></category>

		<guid isPermaLink="false">http://www.tutorialspalace.com/?p=2775</guid>
		<description><![CDATA[Many of website use this script to alternate their table row color that selected from mysql database, very useful and cool. Overview In this tutorial create 1 file 1. alternating_color.php Step 1. Create table &#8220;test_mysql in database &#8220;test&#8221;. 2. Create file alternating_color.php. Step1: Create table &#8220;test_mysql&#8221; 1 2 3 4 5 6 7 8 9 [...]]]></description>
			<content:encoded><![CDATA[<p>Many of website use this script to alternate their table row color that selected from mysql database, very useful and cool.</p>
<p><span id="more-2775"></span></p>
<p><strong>Overview</strong></p>
<p>In this tutorial create 1 file<br />
  1. alternating_color.php </p>
<p>  Step<br />
  1. Create table &#8220;test_mysql in database &#8220;test&#8221;.<br />
  2. Create file alternating_color.php.</p>
<p><h2>Step1:</h2>
<p><strong>Create table &#8220;test_mysql&#8221;</strong></p>
<p><img src="http://www.tutorialspalace.com/wp-content/uploads/2010/04/db_test_mysql.gif" alt="db test mysql Alternating Table Row Colors" width="292" height="127" title="Alternating Table Row Colors" /></p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre>
<pre>&lt;p&gt;CREATE TABLE `test_mysql` (&lt;br&gt;
  `id` int(4) NOT NULL auto_increment,&lt;br&gt;
  `name` varchar(65) NOT NULL default &#039;&#039;,&lt;br&gt;
  `lastname` varchar(65) NOT NULL default &#039;&#039;,&lt;br&gt;
  `email` varchar(65) NOT NULL default &#039;&#039;,&lt;br&gt;
  PRIMARY KEY (`id`)&lt;br&gt;
  ) TYPE=MyISAM AUTO_INCREMENT=7 ;&lt;/p&gt;
&lt;p&gt;-- &lt;br&gt;
  -- Dumping data for table `test_mysql`&lt;br&gt;
  -- &lt;/p&gt;</pre>
</div>
<p></p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
</pre>
<pre>&lt;p&gt;INSERT INTO `test_mysql` VALUES (1, &#039;Billly&#039;, &#039;Blueton&#039;, &#039;bb5@phpeasystep.com&#039;);&lt;br&gt;
  INSERT INTO `test_mysql` VALUES (2, &#039;Jame&#039;, &#039;Campbell&#039;, &#039;jame@somewhere.com&#039;);&lt;br&gt;
  INSERT INTO `test_mysql` VALUES (3, &#039;Mark&#039;, &#039;Jackson&#039;, &#039;mark@phpeasystep.com&#039;);&lt;br&gt;
  INSERT INTO `test_mysql` VALUES (4, &#039;Linda&#039;, &#039;Travor&#039;, &#039;lin65@phpeasystep.com&#039;);&lt;br&gt;
  INSERT INTO `test_mysql` VALUES (5, &#039;Joey&#039;, &#039;Ford&#039;, &#039;fordloi@somewhere.com&#039;);&lt;br&gt;
  INSERT INTO `test_mysql` VALUES (6, &#039;Sidney&#039;, &#039;Gibson&#039;, &#039;gibson@phpeasystep.com&#039;);&lt;/p&gt;</pre>
</div>
<h2>Step2:</h2>
<p><strong>Create file alternating_color.php</strong></p>
<p><img src="http://www.tutorialspalace.com/wp-content/uploads/2010/04/alternate_color.gif" alt="alternate color Alternating Table Row Colors" width="421" height="174" title="Alternating Table Row Colors" /><br />
  View In Browser</p>
<p> <strong>|&#8212;|&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; code &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;|&#8212;|</strong></p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
</pre>
<pre>&lt;p&gt;&lt;?php&lt;br&gt;
  $host=&quot;localhost&quot;; // Host name &lt;br&gt;
  $username=&quot;&quot;; // Mysql username &lt;br&gt;
  $password=&quot;&quot;; // Mysql password &lt;br&gt;
  $db_name=&quot;test&quot;; // Database name &lt;br&gt;
  $tbl_name=&quot;test_mysql&quot;; // Table name&lt;/p&gt;
&lt;p&gt;// Connect to server and select databse&lt;br&gt;
  mysql_connect(&quot;$host&quot;, &quot;$username&quot;, &quot;$password&quot;)or die(&quot;cannot connect&quot;); &lt;br&gt;
  mysql_select_db(&quot;$db_name&quot;)or die(&quot;cannot select DB&quot;);&lt;br&gt;
  &lt;br&gt;
  $sql=&quot;SELECT * FROM $tbl_name&quot;;&lt;br&gt;
  $result=mysql_query($sql);&lt;br&gt;
  &lt;br&gt;
// Define $color=1 &lt;br&gt;
  $color=&quot;1&quot;;&lt;br&gt;
  &lt;br&gt;
  echo &#039;&lt;table width=&quot;400&quot; border=&quot;1&quot; align=&quot;center&quot; cellpadding=&quot;2&quot; cellspacing=&quot;0&quot;&gt;&#039;;&lt;br&gt;
  while($rows=mysql_fetch_array($result)){&lt;/p&gt;
&lt;p&gt;// If $color==1 table row color = #FFC600&lt;br&gt;
  if($color==1){&lt;br&gt;
  echo &quot;&lt;tr bgcolor=&#039;#FFC600&#039;&gt;&lt;br&gt;
  &lt;td&gt;&quot;.$rows[&#039;id&#039;].&quot;&lt;/td&gt;&lt;td&gt;&quot;.$rows[&#039;name&#039;].&quot;&lt;/td&gt;&lt;td&gt;&quot;.$rows[&#039;email&#039;].&quot;&lt;/td&gt;&lt;br&gt;
  &lt;/tr&gt;&quot;;&lt;br&gt;
// Set $color==2, for switching to other color &lt;br&gt;
  $color=&quot;2&quot;;&lt;br&gt;
  }&lt;/p&gt;
&lt;p&gt;// When $color not equal 1, use this table row color &lt;br&gt;
  else {&lt;br&gt;
  echo &quot;&lt;tr bgcolor=&#039;#C6FF00&#039;&gt;&lt;br&gt;
  &lt;td&gt;&quot;.$rows[&#039;id&#039;].&quot;&lt;/td&gt;&lt;td&gt;&quot;.$rows[&#039;name&#039;].&quot;&lt;/td&gt;&lt;td&gt;&quot;.$rows[&#039;email&#039;].&quot;&lt;/td&gt;&lt;br&gt;
  &lt;/tr&gt;&quot;;&lt;br&gt;
// Set $color back to 1 &lt;br&gt;
  $color=&quot;1&quot;;&lt;br&gt;
  }&lt;br&gt;
  &lt;br&gt;
  }&lt;br&gt;
  echo &#039;&lt;/table&gt;&#039;;&lt;br&gt;
  mysql_close();&lt;br&gt;
  ?&gt;&lt;/p&gt;</pre>
</div>
<h2  class="related_post_title">Related Articles</h2><ul class="related_post"><li><a href="http://www.tutorialspalace.com/2011/06/upload-and-rename-file-php-tutorial/" title="Upload and Rename File PHP Tutorial"><img src="http://www.tutorialspalace.com/wp-content/uploads/2010/04/php-up-ren-head.jpg" alt="php up ren head Alternating Table Row Colors"  title="Alternating Table Row Colors" /></a><a href="http://www.tutorialspalace.com/2011/06/upload-and-rename-file-php-tutorial/" title="Upload and Rename File PHP Tutorial">Upload and Rename File PHP Tutorial</a></li><li><a href="http://www.tutorialspalace.com/2011/05/php-encryptions-tutorial/" title="PHP Encryptions Tutorial"><img src="http://www.tutorialspalace.com/wp-content/uploads/2011/05/php-encryption.jpg" alt="php encryption Alternating Table Row Colors"  title="Alternating Table Row Colors" /></a><a href="http://www.tutorialspalace.com/2011/05/php-encryptions-tutorial/" title="PHP Encryptions Tutorial">PHP Encryptions Tutorial</a></li><li><a href="http://www.tutorialspalace.com/2010/04/php-upload-single-file/" title="PHP Upload Single File"><img src="http://www.tutorialspalace.com/wp-content/uploads/2010/04/php-single-fl-up-head.jpg" alt="php single fl up head Alternating Table Row Colors"  title="Alternating Table Row Colors" /></a><a href="http://www.tutorialspalace.com/2010/04/php-upload-single-file/" title="PHP Upload Single File">PHP Upload Single File</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.tutorialspalace.com/2011/03/alternating-table-row-colors/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP Limit Upload File Size</title>
		<link>http://www.tutorialspalace.com/2011/02/php-limit-upload-file-size/</link>
		<comments>http://www.tutorialspalace.com/2011/02/php-limit-upload-file-size/#comments</comments>
		<pubDate>Sun, 20 Feb 2011 19:39:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[upload]]></category>

		<guid isPermaLink="false">http://www.tutorialspalace.com/?p=2766</guid>
		<description><![CDATA[Apply limit on file size at loading time using this tutorial or script. This upload form can limit file size. Overview In this tutorial create 2 files 1. limit_upload.php 2. limit_upload_ac.php Step 1. Create file limit_upload.php 2. Create file limit_upload_ac.php 3. Create folder &#8220;upload&#8221; for store uploaded files. 4. CHMOD your upload folder to &#8220;777&#8243; [...]]]></description>
			<content:encoded><![CDATA[<p>Apply limit on file size at loading time using this tutorial or script. This upload form can limit file size.</p>
<p><span id="more-2766"></span></p>
<p><strong>Overview</strong></p>
<p>In this tutorial create 2 files<br />
  1. limit_upload.php <br />
  2. limit_upload_ac.php</p>
<p>  Step <br />
  1. Create file limit_upload.php<br />
  2. Create file limit_upload_ac.php<br />
  3. Create folder &#8220;upload&#8221; for store uploaded files. <br />
  4. CHMOD your upload folder to &#8220;777&#8243; by using your ftp software(change permission).</p>
<h2>Step1:</h2>
<p><strong>Create file limit_upload.php </strong></p>
<p><img src="http://www.tutorialspalace.com/wp-content/uploads/2010/04/limit_upload.gif" alt="limit upload PHP Limit Upload File Size" width="425" height="110" title="PHP Limit Upload File Size" /></p>
<p><strong>|&#8212;|&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; code &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;|&#8212;|</strong></p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
</pre>
<pre>&lt;table width=&quot;400&quot; border=&quot;0&quot; align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;1&quot; bgcolor=&quot;#CCCCCC&quot;&gt;&lt;br&gt;
  &lt;tr&gt;&lt;br&gt;
  &lt;form action=&quot;limit_upload_ac.php&quot; method=&quot;post&quot; enctype=&quot;multipart/form-data&quot; name=&quot;form1&quot; id=&quot;form1&quot;&gt;&lt;br&gt;
  &lt;td&gt;&lt;br&gt;
  &lt;table width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;3&quot; cellspacing=&quot;1&quot; bgcolor=&quot;#FFFFFF&quot;&gt;&lt;br&gt;
  &lt;tr&gt;&lt;br&gt;
  &lt;td&gt;&lt;strong&gt;File Upload (Limit file size 50 K)&lt;/strong&gt;&lt;/td&gt;&lt;br&gt;
  &lt;/tr&gt;&lt;br&gt;
  &lt;tr&gt;&lt;br&gt;
  &lt;td align=&quot;center&quot;&gt;Select file &lt;br&gt;
  &lt;input name=&quot;ufile&quot; type=&quot;file&quot; id=&quot;ufile&quot; size=&quot;35&quot; /&gt;&lt;/td&gt;&lt;br&gt;
  &lt;/tr&gt;&lt;br&gt;
  &lt;tr&gt;&lt;br&gt;
  &lt;td align=&quot;center&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;Upload&quot; /&gt;&lt;/td&gt;&lt;br&gt;
  &lt;/tr&gt;&lt;br&gt;
  &lt;/table&gt;&lt;br&gt;
  &lt;/td&gt;&lt;br&gt;
  &lt;/form&gt;&lt;br&gt;
  &lt;/tr&gt;&lt;br&gt;
  &lt;/table&gt;&lt;/p&gt;</pre>
</div>
<h2>Step2:</h2>
<p><strong>Create file limit_upload_ac.php</strong></p>
<p><strong>|&#8212;|&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; code &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;|&#8212;|</strong></p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
</pre>
<pre>&lt;p&gt;&lt;?php&lt;br&gt;
// Define file size limit &lt;br&gt;
  $limit_size=50000;&lt;/p&gt;
&lt;p&gt;//set where you want to store files&lt;br&gt;
//in this example we keep file in folder upload &lt;br&gt;
//$HTTP_POST_FILES[&#039;ufile&#039;][&#039;name&#039;]; = upload file name&lt;br&gt;
//for example upload file name cartoon.gif . $path will be upload/cartoon.gif&lt;br&gt;
  $path= &quot;upload/&quot;.$HTTP_POST_FILES[&#039;ufile&#039;][&#039;name&#039;];&lt;br&gt;
  &lt;br&gt;
  if($ufile !=none)&lt;br&gt;
  {&lt;br&gt;
// Store upload file size in $file_size &lt;br&gt;
  $file_size=$HTTP_POST_FILES[&#039;ufile&#039;][&#039;size&#039;];&lt;br&gt;
  &lt;br&gt;
  if($file_size &gt;= $limit_size){&lt;br&gt;
  echo &quot;Your file size is over limit&lt;BR&gt;&quot;;&lt;br&gt;
  echo &quot;Your file size = &quot;.$file_size;&lt;br&gt;
  echo &quot; K&quot;;&lt;br&gt;
  echo &quot;&lt;BR&gt;File size limit = 50000 k&quot;;&lt;br&gt;
  }&lt;br&gt;
  else {&lt;br&gt;
//copy file to where you want to store file&lt;br&gt;
  if(copy($HTTP_POST_FILES[&#039;ufile&#039;][&#039;tmp_name&#039;], $path))&lt;br&gt;
  {&lt;br&gt;
  echo &quot;Successful&lt;BR/&gt;&quot;; &lt;br&gt;
  echo &quot;&lt;img src=\&quot;$path\&quot; width=\&quot;150\&quot; height=\&quot;150\&quot;&gt;&quot;;&lt;br&gt;
  }&lt;br&gt;
  else&lt;br&gt;
  {&lt;br&gt;
  echo &quot;Copy Error&quot;;&lt;br&gt;
  }&lt;br&gt;
  }&lt;br&gt;
  }&lt;br&gt;
  ?&gt;&lt;/p&gt;</pre>
</div>
<h2>Step3:</h2>
<p><strong>CHMOD upload folder to 777 (change permission) </strong></p>
<p>This step, do it when you upload to real <a href="http://www.webhostgear.com/dedicated-servers.php" target="_blank">server</a>. This example, I use CuteFTP, right click at upload folder &gt; FTP Commands &gt; CHMOD</p>
<p><img src="http://www.tutorialspalace.com/wp-content/uploads/2010/04/rfp.gif" alt="rfp PHP Limit Upload File Size" width="235" height="203" title="PHP Limit Upload File Size" /></p>
<h2  class="related_post_title">Related Articles</h2><ul class="related_post"><li><a href="http://www.tutorialspalace.com/2011/06/sparkling-stars-night-effect-3d-max-tutorial/" title="Sparkling Stars Night Effect 3D Max Tutorial"><img src="http://www.tutorialspalace.com/wp-content/uploads/2011/02/sparkling-stars-night-effect.jpg" alt="sparkling stars night effect PHP Limit Upload File Size"  title="PHP Limit Upload File Size" /></a><a href="http://www.tutorialspalace.com/2011/06/sparkling-stars-night-effect-3d-max-tutorial/" title="Sparkling Stars Night Effect 3D Max Tutorial">Sparkling Stars Night Effect 3D Max Tutorial</a></li><li><a href="http://www.tutorialspalace.com/2011/05/php-encryptions-tutorial/" title="PHP Encryptions Tutorial"><img src="http://www.tutorialspalace.com/wp-content/uploads/2011/05/php-encryption.jpg" alt="php encryption PHP Limit Upload File Size"  title="PHP Limit Upload File Size" /></a><a href="http://www.tutorialspalace.com/2011/05/php-encryptions-tutorial/" title="PHP Encryptions Tutorial">PHP Encryptions Tutorial</a></li><li><a href="http://www.tutorialspalace.com/2011/04/25-hit-tutorials-of-animations-in-photoshop/" title="25+ Hit Tutorials of Animations in Photoshop"><img src="http://www.tutorialspalace.com/wp-content/uploads/2011/02/animations-photoshop.jpg" alt="animations photoshop PHP Limit Upload File Size"  title="PHP Limit Upload File Size" /></a><a href="http://www.tutorialspalace.com/2011/04/25-hit-tutorials-of-animations-in-photoshop/" title="25+ Hit Tutorials of Animations in Photoshop">25+ Hit Tutorials of Animations in Photoshop</a></li><li><a href="http://www.tutorialspalace.com/2011/04/studio-light-3d-max-tutorial/" title="Studio Light 3D Max Tutorial"><img src="http://www.tutorialspalace.com/wp-content/uploads/2011/02/studio-light.jpg" alt="studio light PHP Limit Upload File Size"  title="PHP Limit Upload File Size" /></a><a href="http://www.tutorialspalace.com/2011/04/studio-light-3d-max-tutorial/" title="Studio Light 3D Max Tutorial">Studio Light 3D Max Tutorial</a></li><li><a href="http://www.tutorialspalace.com/2011/03/screw-driver-making-tutorial-in-3d-max/" title="Screw Driver Making Tutorial in 3D Max"><img src="http://www.tutorialspalace.com/wp-content/uploads/2011/02/screw-driver.jpg" alt="screw driver PHP Limit Upload File Size"  title="PHP Limit Upload File Size" /></a><a href="http://www.tutorialspalace.com/2011/03/screw-driver-making-tutorial-in-3d-max/" title="Screw Driver Making Tutorial in 3D Max">Screw Driver Making Tutorial in 3D Max</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.tutorialspalace.com/2011/02/php-limit-upload-file-size/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Multiple Files Upload</title>
		<link>http://www.tutorialspalace.com/2011/01/php-multiple-files-upload/</link>
		<comments>http://www.tutorialspalace.com/2011/01/php-multiple-files-upload/#comments</comments>
		<pubDate>Wed, 19 Jan 2011 18:47:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[File Upload]]></category>
		<category><![CDATA[Multi Files Upload Tut]]></category>
		<category><![CDATA[PHP Multiple File Upload Script]]></category>
		<category><![CDATA[PHP Multiple File Upload Tutorial]]></category>

		<guid isPermaLink="false">http://www.tutorialspalace.com/?p=2759</guid>
		<description><![CDATA[You can upload multiple files with one time submittion. Array is a big role in this tutorial, let&#8217;s see the scripts. Overview In this tutorial create 2 files 1. multiple_upload.php 2. multiple_upload_ac.php Step 1. Create file multiple_upload.php 2. Create file multiple_upload_ac.php 3. Create folder &#8220;upload&#8221; for store uploaded files. .4. CHMOD your upload folder to [...]]]></description>
			<content:encoded><![CDATA[<p>You can upload multiple files with one time submittion. Array is a big role in this tutorial, let&#8217;s see the scripts.</p>
<p><span id="more-2759"></span></p>
<p><strong>Overview</strong></p>
<p>In this tutorial create 2 files<br />
  1. multiple_upload.php <br />
  2. multiple_upload_ac.php</p>
<p>  Step <br />
  1. Create file multiple_upload.php<br />
  2. Create file multiple_upload_ac.php<br />
  3. Create folder &#8220;upload&#8221; for store uploaded files. <br />
  .4. CHMOD your upload folder to &#8220;777&#8243; by using your ftp software(change permission).</p>
<h2>Step1:</h2>
<p><strong>Create file multiple_upload.php</strong></p>
<p><img src="http://www.tutorialspalace.com/wp-content/uploads/2010/04/multiple_file_upload_002.gif" alt="multiple file upload 002 PHP Multiple Files Upload" width="531" height="172" title="PHP Multiple Files Upload" /></p>
<p><strong>|&#8212;|&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; code &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;|&#8212;|</strong></p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
</pre>
<pre>&lt;br&gt;
  &lt;table width=&quot;500&quot; border=&quot;0&quot; align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;1&quot; bgcolor=&quot;#CCCCCC&quot;&gt;&lt;br&gt;
  &lt;tr&gt;&lt;br&gt;
  &lt;form action=&quot;multiple_upload_ac.php&quot; method=&quot;post&quot; enctype=&quot;multipart/form-data&quot; name=&quot;form1&quot; id=&quot;form1&quot;&gt;&lt;br&gt;
  &lt;td&gt;&lt;br&gt;
  &lt;table width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;3&quot; cellspacing=&quot;1&quot; bgcolor=&quot;#FFFFFF&quot;&gt;&lt;br&gt;
  &lt;tr&gt;&lt;br&gt;
  &lt;td&gt;&lt;strong&gt;multiple Files Upload &lt;/strong&gt;&lt;/td&gt;&lt;br&gt;
  &lt;/tr&gt;&lt;br&gt;
  &lt;tr&gt;&lt;br&gt;
  &lt;td&gt;Select file &lt;br&gt;
  &lt;input name=&quot;ufile[]&quot; type=&quot;file&quot; id=&quot;ufile[]&quot; size=&quot;50&quot; /&gt;&lt;/td&gt;&lt;br&gt;
  &lt;/tr&gt;&lt;br&gt;
  &lt;tr&gt;&lt;br&gt;
  &lt;td&gt;Select file&lt;br&gt;
  &lt;input name=&quot;ufile[]&quot; type=&quot;file&quot; id=&quot;ufile[]&quot; size=&quot;50&quot; /&gt;&lt;/td&gt;&lt;br&gt;
  &lt;/tr&gt;&lt;br&gt;
  &lt;tr&gt;&lt;br&gt;
  &lt;td&gt;Select file&lt;br&gt;
  &lt;input name=&quot;ufile[]&quot; type=&quot;file&quot; id=&quot;ufile[]&quot; size=&quot;50&quot; /&gt;&lt;/td&gt;&lt;br&gt;
  &lt;/tr&gt;&lt;br&gt;
  &lt;tr&gt;&lt;br&gt;
  &lt;td align=&quot;center&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;Upload&quot; /&gt;&lt;/td&gt;&lt;br&gt;
  &lt;/tr&gt;&lt;br&gt;
  &lt;/table&gt;&lt;br&gt;
  &lt;/td&gt;&lt;br&gt;
  &lt;/form&gt;&lt;br&gt;
  &lt;/tr&gt;&lt;br&gt;
  &lt;/table&gt;&lt;/p&gt;</pre>
</div>
<h2>Step2:</h2>
<p><strong>Create file multiple_upload_ac.php</strong></p>
<p><strong>|&#8212;|&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; code &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;|&#8212;|</strong></p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
</pre>
<pre>&lt;p&gt;&lt;?php&lt;br&gt;
//set where you want to store files&lt;br&gt;
//in this example we keep file in folder upload &lt;br&gt;
//$HTTP_POST_FILES[&#039;ufile&#039;][&#039;name&#039;]; = upload file name&lt;br&gt;
//for example upload file name cartoon.gif . $path will be upload/cartoon.gif&lt;br&gt;
  $path1= &quot;upload/&quot;.$HTTP_POST_FILES[&#039;ufile&#039;][&#039;name&#039;][0];&lt;br&gt;
  $path2= &quot;upload/&quot;.$HTTP_POST_FILES[&#039;ufile&#039;][&#039;name&#039;][1];&lt;br&gt;
  $path3= &quot;upload/&quot;.$HTTP_POST_FILES[&#039;ufile&#039;][&#039;name&#039;][2];&lt;/p&gt;
&lt;p&gt;//copy file to where you want to store file&lt;br&gt;
  copy($HTTP_POST_FILES[&#039;ufile&#039;][&#039;tmp_name&#039;][0], $path1);&lt;br&gt;
  copy($HTTP_POST_FILES[&#039;ufile&#039;][&#039;tmp_name&#039;][1], $path2);&lt;br&gt;
  copy($HTTP_POST_FILES[&#039;ufile&#039;][&#039;tmp_name&#039;][2], $path3);&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;//$HTTP_POST_FILES[&#039;ufile&#039;][&#039;name&#039;] = file name&lt;br&gt;
//$HTTP_POST_FILES[&#039;ufile&#039;][&#039;size&#039;] = file size&lt;br&gt;
//$HTTP_POST_FILES[&#039;ufile&#039;][&#039;type&#039;] = type of file&lt;br&gt;
  echo &quot;File Name :&quot;.$HTTP_POST_FILES[&#039;ufile&#039;][&#039;name&#039;][0].&quot;&lt;BR/&gt;&quot;; &lt;br&gt;
  echo &quot;File Size :&quot;.$HTTP_POST_FILES[&#039;ufile&#039;][&#039;size&#039;][0].&quot;&lt;BR/&gt;&quot;; &lt;br&gt;
  echo &quot;File Type :&quot;.$HTTP_POST_FILES[&#039;ufile&#039;][&#039;type&#039;][0].&quot;&lt;BR/&gt;&quot;; &lt;br&gt;
  echo &quot;&lt;img src=\&quot;$path1\&quot; width=\&quot;150\&quot; height=\&quot;150\&quot;&gt;&quot;;&lt;br&gt;
  echo &quot;&lt;P&gt;&quot;;&lt;/p&gt;
&lt;p&gt;echo &quot;File Name :&quot;.$HTTP_POST_FILES[&#039;ufile&#039;][&#039;name&#039;][1].&quot;&lt;BR/&gt;&quot;; &lt;br&gt;
  echo &quot;File Size :&quot;.$HTTP_POST_FILES[&#039;ufile&#039;][&#039;size&#039;][1].&quot;&lt;BR/&gt;&quot;; &lt;br&gt;
  echo &quot;File Type :&quot;.$HTTP_POST_FILES[&#039;ufile&#039;][&#039;type&#039;][1].&quot;&lt;BR/&gt;&quot;; &lt;br&gt;
  echo &quot;&lt;img src=\&quot;$path2\&quot; width=\&quot;150\&quot; height=\&quot;150\&quot;&gt;&quot;;&lt;br&gt;
  echo &quot;&lt;P&gt;&quot;;&lt;/p&gt;
&lt;p&gt;echo &quot;File Name :&quot;.$HTTP_POST_FILES[&#039;ufile&#039;][&#039;name&#039;][2].&quot;&lt;BR/&gt;&quot;; &lt;br&gt;
  echo &quot;File Size :&quot;.$HTTP_POST_FILES[&#039;ufile&#039;][&#039;size&#039;][2].&quot;&lt;BR/&gt;&quot;; &lt;br&gt;
  echo &quot;File Type :&quot;.$HTTP_POST_FILES[&#039;ufile&#039;][&#039;type&#039;][2].&quot;&lt;BR/&gt;&quot;; &lt;br&gt;
  echo &quot;&lt;img src=\&quot;$path3\&quot; width=\&quot;150\&quot; height=\&quot;150\&quot;&gt;&quot;;&lt;/p&gt;
&lt;p&gt;///////////////////////////////////////////////////////&lt;/p&gt;
&lt;p&gt;// Use this code to display the error or success.&lt;/p&gt;
&lt;p&gt;$filesize1=$HTTP_POST_FILES[&#039;ufile&#039;][&#039;size&#039;][0];&lt;br&gt;
  $filesize2=$HTTP_POST_FILES[&#039;ufile&#039;][&#039;size&#039;][1];&lt;br&gt;
  $filesize3=$HTTP_POST_FILES[&#039;ufile&#039;][&#039;size&#039;][2];&lt;/p&gt;
&lt;p&gt;if($filesize1 &amp;&amp; $filesize2 &amp;&amp; $filesize3 != 0) &lt;br&gt;
  {&lt;br&gt;
  echo &quot;We have recieved your files&quot;;&lt;br&gt;
  }&lt;/p&gt;
&lt;p&gt;else {&lt;br&gt;
  echo &quot;ERROR.....&quot;;&lt;br&gt;
  }&lt;/p&gt;
&lt;p&gt;//////////////////////////////////////////////&lt;/p&gt;
&lt;p&gt;// What files that have a problem? (if found)&lt;/p&gt;
&lt;p&gt;if($filesize1==0) {&lt;br&gt;
  echo &quot;There&#039;re something error in your first file&quot;;&lt;br&gt;
  echo &quot;&lt;BR /&gt;&quot;;&lt;br&gt;
  }&lt;/p&gt;
&lt;p&gt;if($filesize2==0) {&lt;br&gt;
  echo &quot;There&#039;re something error in your second file&quot;;&lt;br&gt;
  echo &quot;&lt;BR /&gt;&quot;;&lt;br&gt;
  }&lt;/p&gt;
&lt;p&gt;if($filesize3==0) {&lt;br&gt;
  echo &quot;There&#039;re something error in your third file&quot;;&lt;br&gt;
  echo &quot;&lt;BR /&gt;&quot;;&lt;br&gt;
  }&lt;/p&gt;
&lt;p&gt;?&gt;&lt;/p&gt;</pre>
</div>
<h2>Step3:</h2>
<p><strong>CHMOD upload folder to 777 (change permission)</strong></p>
<p>This step, do it when you upload to real server. This example, I use CuteFTP, right click at upload folder &gt; FTP Commands &gt; CHMOD</p>
<p><img src="http://www.tutorialspalace.com/wp-content/uploads/2010/04/rfp.gif" alt="rfp PHP Multiple Files Upload" width="235" height="203" title="PHP Multiple Files Upload" /></p></p>
<h2  class="related_post_title">Random Posts</h2><ul class="related_post"><li><a href="http://www.tutorialspalace.com/2010/09/25-ultimate-collection-of-useful-joomla-tutorials/" title="25 Ultimate Collection of Useful Joomla Tutorials"><img src="http://www.tutorialspalace.com/wp-content/uploads/2010/09/joomla-tuts-head.jpg" alt="joomla tuts head PHP Multiple Files Upload"  title="PHP Multiple Files Upload" /></a><a href="http://www.tutorialspalace.com/2010/09/25-ultimate-collection-of-useful-joomla-tutorials/" title="25 Ultimate Collection of Useful Joomla Tutorials">25 Ultimate Collection of Useful Joomla Tutorials</a></li><li><a href="http://www.tutorialspalace.com/2011/05/making-of-toothbrush-in-3d-max/" title="Making of Toothbrush in 3D Max"><img src="http://www.tutorialspalace.com/wp-content/uploads/2011/02/toothbrush-3d-final.jpg" alt="toothbrush 3d final PHP Multiple Files Upload"  title="PHP Multiple Files Upload" /></a><a href="http://www.tutorialspalace.com/2011/05/making-of-toothbrush-in-3d-max/" title="Making of Toothbrush in 3D Max">Making of Toothbrush in 3D Max</a></li><li><a href="http://www.tutorialspalace.com/2011/07/cross-cultural-web-design/" title="Cross-Cultural Web Design"><img src="http://www.tutorialspalace.com/wp-content/uploads/2011/07/cross-cultural-web-design.jpg" alt="cross cultural web design PHP Multiple Files Upload"  title="PHP Multiple Files Upload" /></a><a href="http://www.tutorialspalace.com/2011/07/cross-cultural-web-design/" title="Cross-Cultural Web Design">Cross-Cultural Web Design</a></li><li><a href="http://www.tutorialspalace.com/2011/03/20-smartest-adobe-flash-menu-and-navigation-tutorials/" title="20+ Smartest Adobe Flash Menu and Navigation Tutorials"><img src="http://www.tutorialspalace.com/wp-content/uploads/2011/02/flash-menu-design-tutorials.jpg" alt="flash menu design tutorials PHP Multiple Files Upload"  title="PHP Multiple Files Upload" /></a><a href="http://www.tutorialspalace.com/2011/03/20-smartest-adobe-flash-menu-and-navigation-tutorials/" title="20+ Smartest Adobe Flash Menu and Navigation Tutorials">20+ Smartest Adobe Flash Menu and Navigation Tutorials</a></li><li><a href="http://www.tutorialspalace.com/2010/12/35-extraordinary-new-year-2011-wallpapers-for-make-trends/" title="35+ Extraordinary New Year 2011 Wallpapers for Make Trends"><img src="http://www.tutorialspalace.com/wp-content/uploads/2010/12/Happy-New-Year-2011-head.jpg" alt="Happy New Year 2011 head PHP Multiple Files Upload"  title="PHP Multiple Files Upload" /></a><a href="http://www.tutorialspalace.com/2010/12/35-extraordinary-new-year-2011-wallpapers-for-make-trends/" title="35+ Extraordinary New Year 2011 Wallpapers for Make Trends">35+ Extraordinary New Year 2011 Wallpapers for Make Trends</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.tutorialspalace.com/2011/01/php-multiple-files-upload/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get Width and Height of an Image in PHP</title>
		<link>http://www.tutorialspalace.com/2010/12/get-width-and-height-of-an-image-in-php/</link>
		<comments>http://www.tutorialspalace.com/2010/12/get-width-and-height-of-an-image-in-php/#comments</comments>
		<pubDate>Sat, 18 Dec 2010 10:15:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Get Image Height and Width]]></category>
		<category><![CDATA[PHP Image Size Tutorial]]></category>

		<guid isPermaLink="false">http://www.tutorialspalace.com/?p=2837</guid>
		<description><![CDATA[PHP provides a function to get the width and height of an image. &#34;getimagesize()&#34; This function will determine the size of image file and also will get size of flash file(swf). Syntax list($width, $height, $type, $attr) = getimagesize(&#34;image_name.jpg&#34;); &#124;&#8212;&#124;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; code &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&#124;&#8212;&#124; This is a sample code, change image_name to your image name and test it! [...]]]></description>
			<content:encoded><![CDATA[<p>PHP provides a function to get the width and height of an image. &quot;getimagesize()&quot; This function will determine the size of image file and also will get size of flash file(swf).</p>
<p><span id="more-2837"></span></p>
<p><strong>Syntax</strong></p>
<p>list($width, $height, $type, $attr) = getimagesize(&quot;image_name.jpg&quot;);</p>
<p><strong>|&#8212;|&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; code &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;|&#8212;|</strong></p>
<p>This is a sample code, change image_name to your image name and test it! </p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre>
<pre>&lt;?php&lt;br /&gt;
&lt;br /&gt;
list($width, $height, $type, $attr) = getimagesize(&quot;&lt;strong&gt;image_name.jpg&lt;/strong&gt;&quot;);&lt;/p&gt;
&lt;p&gt;echo &quot;Image width &quot; .$width;&lt;br /&gt;
echo &quot;&lt;BR&gt;&quot;;&lt;br /&gt;
echo &quot;Image height &quot; .$height;&lt;br /&gt;
echo &quot;&lt;BR&gt;&quot;;&lt;br /&gt;
echo &quot;Image type &quot; .$type;&lt;br /&gt;
echo &quot;&lt;BR&gt;&quot;;&lt;br /&gt;
echo &quot;Attribute &quot; .$attr;&lt;br /&gt;
&lt;br /&gt;
?&gt;&lt;br /&gt;</pre>
</div>
<p>When you run this script you will see the result like this</p>
<p>  Image width<strong> 640</strong><br />
  Image height <strong>480</strong><br />
  Image type <strong>2</strong><br />
  Image attribute <strong>width=&quot;640&quot; height=&quot;480&quot;</strong></p>
<p>  You will get the width, height, type of an image and also attribute of an image, I use this function in my image upload form. <br />
  Type of an image you can see from table below</p>
<table border="0" cellpadding="4" cellspacing="0" width="100%">
<tbody>
<tr>
<td colspan="2">
<h3>Type of the image</h3>
</td>
</tr>
<tr>
<td width="50%">1 = GIF</td>
<td width="50%">9 = JPC</td>
</tr>
<tr>
<td>2 = JPG</td>
<td>10 = JP2</td>
</tr>
<tr>
<td>3 = PNG</td>
<td>11 = JPX</td>
</tr>
<tr>
<td>4 = SWF</td>
<td> 12 = JB2</td>
</tr>
<tr>
<td>5 = PSD</td>
<td>13 = SWC</td>
</tr>
<tr>
<td>6 = BMP</td>
<td>14 = IFF</td>
</tr>
<tr>
<td>7 = TIFF(intel byte order)</td>
<td>15 = WBMP</td>
</tr>
<tr>
<td>8 = TIFF(motorola byte order)</td>
<td>16 = XBM</td>
</tr>
</tbody>
</table>
<h2  class="related_post_title">Random Posts</h2><ul class="related_post"><li><a href="http://www.tutorialspalace.com/2012/01/best-resources-for-submit-design-tutorials/" title="Best Resources for Submit Design Tutorials"><img src="http://www.tutorialspalace.com/wp-content/uploads/2012/01/resources-submit-design-tutorials.jpg" alt="resources submit design tutorials Get Width and Height of an Image in PHP"  title="Get Width and Height of an Image in PHP" /></a><a href="http://www.tutorialspalace.com/2012/01/best-resources-for-submit-design-tutorials/" title="Best Resources for Submit Design Tutorials">Best Resources for Submit Design Tutorials</a></li><li><a href="http://www.tutorialspalace.com/2010/03/how-to-make-necklace-in-adobe-illustrator/" title="How to make Necklace in Adobe Illustrator"><img src="http://www.tutorialspalace.com/wp-content/uploads/2010/03/necklace-tut-head.jpg" alt="necklace tut head Get Width and Height of an Image in PHP"  title="Get Width and Height of an Image in PHP" /></a><a href="http://www.tutorialspalace.com/2010/03/how-to-make-necklace-in-adobe-illustrator/" title="How to make Necklace in Adobe Illustrator">How to make Necklace in Adobe Illustrator</a></li><li><a href="http://www.tutorialspalace.com/2012/02/marvelous-collection-of-cinema-4d-tutorials/" title="Marvelous Collection of CINEMA 4D Tutorials"><img src="http://www.tutorialspalace.com/wp-content/uploads/2012/02/marvelous-cinema-4d-tutorials.jpg" alt="marvelous cinema 4d tutorials Get Width and Height of an Image in PHP"  title="Get Width and Height of an Image in PHP" /></a><a href="http://www.tutorialspalace.com/2012/02/marvelous-collection-of-cinema-4d-tutorials/" title="Marvelous Collection of CINEMA 4D Tutorials">Marvelous Collection of CINEMA 4D Tutorials</a></li><li><a href="http://www.tutorialspalace.com/2010/09/how-to-fullscreen-flash-file-in-browser/" title="How to Fullscreen Flash File in Browser"><img src="http://www.tutorialspalace.com/wp-content/uploads/2010/09/flash-fullscreen-head.jpg" alt="flash fullscreen head Get Width and Height of an Image in PHP"  title="Get Width and Height of an Image in PHP" /></a><a href="http://www.tutorialspalace.com/2010/09/how-to-fullscreen-flash-file-in-browser/" title="How to Fullscreen Flash File in Browser">How to Fullscreen Flash File in Browser</a></li><li><a href="http://www.tutorialspalace.com/2010/09/25-ultimate-collection-of-useful-joomla-tutorials/" title="25 Ultimate Collection of Useful Joomla Tutorials"><img src="http://www.tutorialspalace.com/wp-content/uploads/2010/09/joomla-tuts-head.jpg" alt="joomla tuts head Get Width and Height of an Image in PHP"  title="Get Width and Height of an Image in PHP" /></a><a href="http://www.tutorialspalace.com/2010/09/25-ultimate-collection-of-useful-joomla-tutorials/" title="25 Ultimate Collection of Useful Joomla Tutorials">25 Ultimate Collection of Useful Joomla Tutorials</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.tutorialspalace.com/2010/12/get-width-and-height-of-an-image-in-php/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Simple Ad Rotation PHP Tutorial</title>
		<link>http://www.tutorialspalace.com/2010/11/simple-ad-rotation-php-tutorial/</link>
		<comments>http://www.tutorialspalace.com/2010/11/simple-ad-rotation-php-tutorial/#comments</comments>
		<pubDate>Mon, 22 Nov 2010 07:30:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Ad Rotation Script]]></category>
		<category><![CDATA[Ad Rotator Tutorial]]></category>
		<category><![CDATA[PHP Ad Rotate Tutorial]]></category>
		<category><![CDATA[Simple Ad Rotation PHP Tutorial]]></category>

		<guid isPermaLink="false">http://www.tutorialspalace.com/?p=2822</guid>
		<description><![CDATA[This is a very simple and easy ad rotation tutorial, you can set percentage to show the ads and you can adapt this script to rotate any thing.&#160;In this script (very easy script), we have 3 ads for rotation first ad we want it to display 70%, second ad we want to display 20% and [...]]]></description>
			<content:encoded><![CDATA[<p>This is a very simple and easy ad rotation tutorial, you can set percentage to show the ads and you can adapt this script to rotate any thing.&nbsp;In this script (very easy script), we have 3 ads for rotation first ad we want it to display 70%, second ad we want to display 20% and the last one we want to display 10% </p>
<p><span id="more-2822"></span><br />
  <br />
  <strong>What to do<br />
  </strong><br />
  1. Random number 1-100<br />
  &#8211; if result = 1-70 (we have opportunity to display ad 1, 70%)<br />
  &#8211; if result = 71-90 (we have opportunity to display ad 2, 20%)<br />
  &#8211; if result = 91-100 (we have opportunity to display ad 3, 10%)</p>
<p>  <strong>Example</strong></p>
<p>In this script use rand(1, 100); to random number between 1 -100 and keep result in variable name &quot;$result_rand&quot; if result = 85 ad 2 will display. </p>
<p><strong>|&#8212;|&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; code &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;|&#8212;|</strong></p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
</pre>
<pre>&lt;p&gt;&lt;?php&lt;br /&gt;
  &lt;br /&gt;
// random number 1 - 100 &lt;br /&gt;
$result_rand=rand(1, 100);&lt;/p&gt;
&lt;p&gt;// if result less than or equal 70, display ad 1 (70%)&lt;br /&gt;
  if($result_rand&lt;=70){&lt;br /&gt;
  echo &quot;Display ad1&quot;;&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
// if result less than or equal 90, display ad 2 (20%)&lt;br /&gt;
  elseif($result_rand&lt;=90){&lt;br /&gt;
  echo &quot;Display ad2&quot;;&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
// if result less than or equal 100, display ad 3 (10%)&lt;br /&gt;
  elseif($result_rand&lt;=100){&lt;br /&gt;
  echo &quot;Display ad3&quot;;&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  ?&gt;&lt;/p&gt;</pre>
</div>
<h2  class="related_post_title">Random Posts</h2><ul class="related_post"><li><a href="http://www.tutorialspalace.com/2011/04/25-hit-tutorials-of-animations-in-photoshop/" title="25+ Hit Tutorials of Animations in Photoshop"><img src="http://www.tutorialspalace.com/wp-content/uploads/2011/02/animations-photoshop.jpg" alt="animations photoshop Simple Ad Rotation PHP Tutorial"  title="Simple Ad Rotation PHP Tutorial" /></a><a href="http://www.tutorialspalace.com/2011/04/25-hit-tutorials-of-animations-in-photoshop/" title="25+ Hit Tutorials of Animations in Photoshop">25+ Hit Tutorials of Animations in Photoshop</a></li><li><a href="http://www.tutorialspalace.com/2012/01/professional-trainings-of-animations-in-adobe-flash/" title="Professional Trainings of Animations in Adobe Flash"><img src="http://www.tutorialspalace.com/wp-content/uploads/2012/01/animations-in-adobe-flash.jpg" alt="animations in adobe flash Simple Ad Rotation PHP Tutorial"  title="Simple Ad Rotation PHP Tutorial" /></a><a href="http://www.tutorialspalace.com/2012/01/professional-trainings-of-animations-in-adobe-flash/" title="Professional Trainings of Animations in Adobe Flash">Professional Trainings of Animations in Adobe Flash</a></li><li><a href="http://www.tutorialspalace.com/2010/09/50-photoshop-illustrator-effects-and-tutorials/" title="50 Photoshop Illustrator Effects and Tutorials"><img src="http://www.tutorialspalace.com/wp-content/uploads/2010/02/tuts-illustrator50-head.jpg" alt="tuts illustrator50 head Simple Ad Rotation PHP Tutorial"  title="Simple Ad Rotation PHP Tutorial" /></a><a href="http://www.tutorialspalace.com/2010/09/50-photoshop-illustrator-effects-and-tutorials/" title="50 Photoshop Illustrator Effects and Tutorials">50 Photoshop Illustrator Effects and Tutorials</a></li><li><a href="http://www.tutorialspalace.com/2009/10/phoenix-hair-effect/" title="Phoenix Hair Effect"><img src="http://www.tutorialspalace.com/wp-content/uploads/2009/10/phoenix-hair.jpg" alt="phoenix hair Simple Ad Rotation PHP Tutorial"  title="Simple Ad Rotation PHP Tutorial" /></a><a href="http://www.tutorialspalace.com/2009/10/phoenix-hair-effect/" title="Phoenix Hair Effect">Phoenix Hair Effect</a></li><li><a href="http://www.tutorialspalace.com/2011/05/how-to-apply-conditional-styling-for-internet-explorer/" title="How to Apply Conditional Styling for Internet Explorer"><img src="http://www.tutorialspalace.com/wp-content/uploads/2011/05/conditional-styling-for-internet-explorer.jpg" alt="conditional styling for internet explorer Simple Ad Rotation PHP Tutorial"  title="Simple Ad Rotation PHP Tutorial" /></a><a href="http://www.tutorialspalace.com/2011/05/how-to-apply-conditional-styling-for-internet-explorer/" title="How to Apply Conditional Styling for Internet Explorer">How to Apply Conditional Styling for Internet Explorer</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.tutorialspalace.com/2010/11/simple-ad-rotation-php-tutorial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Encrypting Password Using md5() Function</title>
		<link>http://www.tutorialspalace.com/2010/09/encrypting-password-using-md5-function/</link>
		<comments>http://www.tutorialspalace.com/2010/09/encrypting-password-using-md5-function/#comments</comments>
		<pubDate>Wed, 22 Sep 2010 18:45:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Encrypted Password]]></category>
		<category><![CDATA[Password Encryption PHP Script]]></category>
		<category><![CDATA[Password Encryption Tutorial]]></category>

		<guid isPermaLink="false">http://www.tutorialspalace.com/?p=2848</guid>
		<description><![CDATA[This turorial will teach you that how to make your login system more secure. We will use md5(); function for this. Syntax 1 2 3 4 5 &#60;p&#62;$pwd=&#34;123456&#34;;&#60;br /&#62; &#60;br /&#62; md5($pwd);&#60;br /&#62; Use md5(); to encrypts password to make it more secure Overview Look at these two databases, it&#8217;s the same person and same [...]]]></description>
			<content:encoded><![CDATA[<p>This turorial will teach you that how to make your login system more secure. We will use md5(); function for this.</p>
<p><span id="more-2848"></span><br />
<strong>Syntax</strong></p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
</pre>
<pre>&lt;p&gt;$pwd=&quot;123456&quot;;&lt;br /&gt;
 &lt;br /&gt;
 md5($pwd);&lt;br /&gt;</pre>
</div>
<p>
 Use md5(); to encrypts password to make it  more secure </p>
<p><strong>Overview</strong></p>
<p>Look at these two  databases, it&#8217;s the same person and same info, the first one we don&#8217;t  encrypt his password but the second one we encrypted his password <br />
 <img src="http://www.tutorialspalace.com/wp-content/uploads/2010/04/encrypt_password.gif" height="195" width="500" title="Encrypting Password Using md5() Function" alt="encrypt password Encrypting Password Using md5() Function" /></p>
<p>when you encryte  &quot;john856&quot; using this code, you&#8217;ll see this result<br />
 &quot;<strong>ad65d5054042fda44ba3fdc97cee80c6</strong>&quot;  This is not a random result,  everytime you encrypt the same password you will get the same result.</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
</pre>
<pre>$pwd=&quot;john856&quot;;&lt;br /&gt;
$encrypt_pwd=md5($pwd);&lt;/p&gt;
&lt;p&gt;echo  $encrypt_pwd; &lt;/p&gt;</pre>
</div>
<p>
<strong>Example  &#8211; Login</strong>
</td>
<p>
This is an example Login with encrypted  password but don&#8217;t forget to encrypt password and insert into database  in sign up process.</p>
<p>// username and password sent from form </p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre>
<pre>$tpuser=$_POST[&#039;user&#039;]; &lt;br /&gt;
 $tppass=$_POST[&#039;pass&#039;]; &lt;br /&gt;
 &lt;br /&gt;
// encrypt password &lt;br /&gt;
 $encrypted_pwd=md5($tppass);&lt;/p&gt;
&lt;p&gt;$sql=&quot;SELECT  * FROM $tbl_name WHERE username=&#039;$tpuser&#039; and  password=&#039;$encrypted_pwd&#039;&quot;;&lt;br /&gt;
$result=mysql_query($sql);&lt;br /&gt;
&lt;/p&gt;</pre>
</div>
<h2  class="related_post_title">Random Posts</h2><ul class="related_post"><li><a href="http://www.tutorialspalace.com/2010/11/3d-effects-of-flash-cs4-and-papervision-tutorials/" title="3D Effects of Flash CS4 and Papervision Tutorials"><img src="http://www.tutorialspalace.com/wp-content/uploads/2010/10/papervision3d-head.jpg" alt="papervision3d head Encrypting Password Using md5() Function"  title="Encrypting Password Using md5() Function" /></a><a href="http://www.tutorialspalace.com/2010/11/3d-effects-of-flash-cs4-and-papervision-tutorials/" title="3D Effects of Flash CS4 and Papervision Tutorials">3D Effects of Flash CS4 and Papervision Tutorials</a></li><li><a href="http://www.tutorialspalace.com/2011/02/45-cool-illustrator-cartoon-tutorials/" title="45+ Cool Illustrator Cartoon Tutorials"><img src="http://www.tutorialspalace.com/wp-content/uploads/2010/03/cartoon-ill-50-head.jpg" alt="cartoon ill 50 head Encrypting Password Using md5() Function"  title="Encrypting Password Using md5() Function" /></a><a href="http://www.tutorialspalace.com/2011/02/45-cool-illustrator-cartoon-tutorials/" title="45+ Cool Illustrator Cartoon Tutorials">45+ Cool Illustrator Cartoon Tutorials</a></li><li><a href="http://www.tutorialspalace.com/2010/04/how-to-make-photo-to-vector-illustration-effect/" title="How to Make Photo to Vector Illustration Effect"><img src="http://www.tutorialspalace.com/wp-content/uploads/2010/03/photo-illust-head.jpg" alt="photo illust head Encrypting Password Using md5() Function"  title="Encrypting Password Using md5() Function" /></a><a href="http://www.tutorialspalace.com/2010/04/how-to-make-photo-to-vector-illustration-effect/" title="How to Make Photo to Vector Illustration Effect">How to Make Photo to Vector Illustration Effect</a></li><li><a href="http://www.tutorialspalace.com/2011/02/15-surprising-typography-designs-of-photoshop-text-upshot-tutorials/" title="15 Surprising Typography Designs of Photoshop Text Upshot Tutorials"><img src="http://www.tutorialspalace.com/wp-content/uploads/2010/12/typography-design-tutorials.jpg" alt="typography design tutorials Encrypting Password Using md5() Function"  title="Encrypting Password Using md5() Function" /></a><a href="http://www.tutorialspalace.com/2011/02/15-surprising-typography-designs-of-photoshop-text-upshot-tutorials/" title="15 Surprising Typography Designs of Photoshop Text Upshot Tutorials">15 Surprising Typography Designs of Photoshop Text Upshot Tutorials</a></li><li><a href="http://www.tutorialspalace.com/2011/06/adobe-dreamweaver-cs4-tutorials-for-beginner/" title="Adobe Dreamweaver CS4 Tutorials for Beginner"><img src="http://www.tutorialspalace.com/wp-content/uploads/2011/06/adobe-dreamweaver-cs4-tutorials.jpg" alt="adobe dreamweaver cs4 tutorials Encrypting Password Using md5() Function"  title="Encrypting Password Using md5() Function" /></a><a href="http://www.tutorialspalace.com/2011/06/adobe-dreamweaver-cs4-tutorials-for-beginner/" title="Adobe Dreamweaver CS4 Tutorials for Beginner">Adobe Dreamweaver CS4 Tutorials for Beginner</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.tutorialspalace.com/2010/09/encrypting-password-using-md5-function/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>PHP Login Script Tutorial</title>
		<link>http://www.tutorialspalace.com/2010/07/php-login-script-tutorial/</link>
		<comments>http://www.tutorialspalace.com/2010/07/php-login-script-tutorial/#comments</comments>
		<pubDate>Fri, 30 Jul 2010 16:52:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Login Script Tutorial]]></category>
		<category><![CDATA[Login System Script]]></category>
		<category><![CDATA[PHP Login Script Tutorial]]></category>
		<category><![CDATA[PHP Login Tutorial]]></category>
		<category><![CDATA[Simple Login System]]></category>

		<guid isPermaLink="false">http://www.tutorialspalace.com/?p=2776</guid>
		<description><![CDATA[Learn to create a simple login system with php + mysql script, this tutorial easy to follow, teach you step by step. Overview In this tutorial create 3 files 1. main_login.php 2. checklogin.php 3. login_success.php Step 1. Create table &#8220;members&#8221; in database &#8220;test&#8221;. 2. Create file main_login.php. 3. Create file checklogin.php. 4. Create file login_success.php. [...]]]></description>
			<content:encoded><![CDATA[<p>Learn to  create a simple login system with php + mysql script, this tutorial easy to follow, teach you step by step.</p>
<p><span id="more-2776"></span></p>
<p><strong>Overview</strong></p>
<p>In this tutorial  create 3 files<br />
  1. main_login.php <br />
  2. checklogin.php<br />
  3. login_success.php </p>
<p>  Step<br />
  1. Create table &#8220;members&#8221;  in database &#8220;test&#8221;.<br />
  2. Create file  main_login.php.<br />
  3. Create file  checklogin.php.<br />
  4. Create file  login_success.php. <br />
  5. Create file logout.php</p>
<h2>Step1:</h2>
<p><strong>Create table &#8220;members&#8221;</strong></p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre>
<pre>&lt;p&gt;CREATE TABLE `members` (&lt;br&gt;
  `id` int(4) NOT NULL auto_increment,&lt;br&gt;
  `username` varchar(65) NOT NULL default &#039;&#039;,&lt;br&gt;
  `password` varchar(65) NOT NULL default &#039;&#039;,&lt;br&gt;
  PRIMARY KEY (`id`)&lt;br&gt;
  ) TYPE=MyISAM AUTO_INCREMENT=2 ;&lt;/p&gt;
&lt;p&gt;-- &lt;br&gt;
  -- Dumping data for table `members`&lt;br&gt;
  -- &lt;/p&gt;</pre>
</div>
<p></p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
</pre>
<pre>&lt;p&gt;INSERT INTO `members` VALUES (1, &#039;john&#039;, &#039;1234&#039;);&lt;/p&gt;</pre>
</div>
<p><img src="http://www.tutorialspalace.com/wp-content/uploads/2010/04/db_members.gif" alt="db members PHP Login Script Tutorial" width="168" height="118" title="PHP Login Script Tutorial" /></p>
<h2>Step2:</h2>
<p><strong>Create file main_login.php</strong></p>
<p><img src="http://www.tutorialspalace.com/wp-content/uploads/2010/04/member_login.gif" alt="member login PHP Login Script Tutorial" width="381" height="167" title="PHP Login Script Tutorial" /><br />
  View In Browser </p>
<p> <strong>|&#8212;|&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; code &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;|&#8212;|</strong> </p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
</pre>
<pre>&lt;p&gt;&lt;table width=&quot;300&quot; border=&quot;0&quot; align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;1&quot; bgcolor=&quot;#CCCCCC&quot;&gt;&lt;br&gt;
  &lt;tr&gt;&lt;br&gt;
&lt;form name=&quot;form1&quot; method=&quot;post&quot; action=&quot;checklogin.php&quot;&gt;&lt;br&gt;
  &lt;td&gt;&lt;br&gt;
  &lt;table width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;3&quot; cellspacing=&quot;1&quot; bgcolor=&quot;#FFFFFF&quot;&gt;&lt;br&gt;
  &lt;tr&gt;&lt;br&gt;
  &lt;td colspan=&quot;3&quot;&gt;&lt;strong&gt;Member Login &lt;/strong&gt;&lt;/td&gt;&lt;br&gt;
  &lt;/tr&gt;&lt;br&gt;
  &lt;tr&gt;&lt;br&gt;
  &lt;td width=&quot;78&quot;&gt;Username&lt;/td&gt;&lt;br&gt;
  &lt;td width=&quot;6&quot;&gt;:&lt;/td&gt;&lt;br&gt;
  &lt;td width=&quot;294&quot;&gt;&lt;input name=&quot;myusername&quot; type=&quot;text&quot; id=&quot;myusername&quot;&gt;&lt;/td&gt;&lt;br&gt;
  &lt;/tr&gt;&lt;br&gt;
  &lt;tr&gt;&lt;br&gt;
  &lt;td&gt;Password&lt;/td&gt;&lt;br&gt;
  &lt;td&gt;:&lt;/td&gt;&lt;br&gt;
  &lt;td&gt;&lt;input name=&quot;mypassword&quot; type=&quot;text&quot; id=&quot;mypassword&quot;&gt;&lt;/td&gt;&lt;br&gt;
  &lt;/tr&gt;&lt;br&gt;
  &lt;tr&gt;&lt;br&gt;
  &lt;td&gt;&nbsp;&lt;/td&gt;&lt;br&gt;
  &lt;td&gt;&nbsp;&lt;/td&gt;&lt;br&gt;
  &lt;td&gt;&lt;input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;Login&quot;&gt;&lt;/td&gt;&lt;br&gt;
  &lt;/tr&gt;&lt;br&gt;
  &lt;/table&gt;&lt;br&gt;
  &lt;/td&gt;&lt;br&gt;
&lt;/form&gt;&lt;br&gt;
  &lt;/tr&gt;&lt;br&gt;
  &lt;/table&gt;&lt;/p&gt;</pre>
</div>
<h2>Step3:</h2>
<p><strong>Create file checklogin.php</strong></p>
<p><strong>|&#8212;|&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; code &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;|&#8212;|</strong></p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
</pre>
<pre>&lt;p&gt;&lt;?php&lt;br&gt;
$host=&quot;localhost&quot;; // Host name &lt;br&gt;
$username=&quot;&quot;; // Mysql username &lt;br&gt;
$password=&quot;&quot;; // Mysql password &lt;br&gt;
$db_name=&quot;test&quot;; // Database name &lt;br&gt;
$tbl_name=&quot;members&quot;; // Table name &lt;/p&gt;
&lt;p&gt;// Connect to server and select databse.&lt;br&gt;
  mysql_connect(&quot;$host&quot;, &quot;$username&quot;, &quot;$password&quot;)or die(&quot;cannot connect&quot;); &lt;br&gt;
  mysql_select_db(&quot;$db_name&quot;)or die(&quot;cannot select DB&quot;);&lt;/p&gt;
&lt;p&gt;// username and password sent from form &lt;br&gt;
  $myusername=$_POST[&#039;myusername&#039;]; &lt;br&gt;
  $mypassword=$_POST[&#039;mypassword&#039;]; &lt;/p&gt;
&lt;p&gt;// To protect MySQL injection (&lt;a href=&quot;http://us.php.net/mysql_real_escape_string&quot; target=&quot;_blank&quot;&gt;more detail about MySQL injection&lt;/a&gt;)&lt;br&gt;
  $myusername = stripslashes($myusername);&lt;br&gt;
  $mypassword = stripslashes($mypassword);&lt;br&gt;
  $myusername = mysql_real_escape_string($myusername);&lt;br&gt;
  $mypassword = mysql_real_escape_string($mypassword);&lt;/p&gt;
&lt;p&gt;$sql=&quot;SELECT * FROM $tbl_name WHERE username=&#039;$myusername&#039; and password=&#039;$mypassword&#039;&quot;;&lt;br&gt;
  $result=mysql_query($sql);&lt;/p&gt;
&lt;p&gt;// Mysql_num_row is counting table row&lt;br&gt;
  $count=mysql_num_rows($result);&lt;br&gt;
// If result matched $myusername and $mypassword, table row must be 1 row&lt;/p&gt;
&lt;p&gt;if($count==1){&lt;br&gt;
// Register $myusername, $mypassword and redirect to file &quot;login_success.php&quot;&lt;br&gt;
session_register(&quot;myusername&quot;);&lt;br&gt;
session_register(&quot;mypassword&quot;); &lt;br&gt;
header(&quot;location:login_success.php&quot;);&lt;br&gt;
}&lt;br&gt;
else {&lt;br&gt;
echo &quot;Wrong Username or Password&quot;;&lt;br&gt;
}&lt;br&gt;
?&gt;&lt;/p&gt;</pre>
</div>
<h2>Step4:</h2>
<p><strong>Create file login_success.php </strong> </p>
<p> <strong>|&#8212;|&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; code &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;|&#8212;|</strong> </p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
</pre>
<pre>&lt;p&gt;// Check if session is not registered , redirect back to main page. &lt;br&gt;
// Put this code in first line of web page. &lt;br&gt;
  &lt;? &lt;br&gt;
  session_start();&lt;br&gt;
  if(!session_is_registered(myusername)){&lt;br&gt;
  header(&quot;location:main_login.php&quot;);&lt;br&gt;
  }&lt;br&gt;
  ?&gt;&lt;br&gt;
  &lt;br&gt;
  &lt;html&gt;&lt;br&gt;
  &lt;body&gt;&lt;br&gt;
  Login Successful&lt;br&gt;
  &lt;/body&gt;&lt;br&gt;
  &lt;/html&gt;&lt;/p&gt;</pre>
</div>
<h2>Step5:</h2>
<p><strong>Logout.php</strong> </p>
<p><strong>If  you want to logout, create this file</strong></p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
</pre>
<pre>// Put this code in first line of web page. &lt;br&gt;
&lt;? &lt;br&gt;
session_start();&lt;br&gt;
session_destroy();&lt;br&gt;
?&gt;</pre>
</div>
<h2>Step6:</h2>
<p><strong>For PHP5 User &#8211; checklogin.php</strong></p>
<p> <strong>|&#8212;|&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; code &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;|&#8212;|</strong> </p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
</pre>
<pre>&lt;?php&lt;br&gt;
ob_start();&lt;br&gt;
$host=&quot;localhost&quot;; // Host name &lt;br&gt;
$username=&quot;&quot;; // Mysql username &lt;br&gt;
$password=&quot;&quot;; // Mysql password &lt;br&gt;
$db_name=&quot;test&quot;; // Database name &lt;br&gt;
$tbl_name=&quot;members&quot;; // Table name
&lt;p&gt;// Connect to server and select databse.&lt;br&gt;
  mysql_connect(&quot;$host&quot;, &quot;$username&quot;, &quot;$password&quot;)or die(&quot;cannot connect&quot;); &lt;br&gt;
  mysql_select_db(&quot;$db_name&quot;)or die(&quot;cannot select DB&quot;);&lt;/p&gt;
&lt;p&gt; // Define $myusername and $mypassword &lt;br&gt;
  $myusername=$_POST[&#039;myusername&#039;]; &lt;br&gt;
  $mypassword=$_POST[&#039;mypassword&#039;]; &lt;/p&gt;
&lt;p&gt;// To protect MySQL injection (&lt;a href=&quot;http://us.php.net/mysql_real_escape_string&quot;&gt;more detail about MySQL injection&lt;/a&gt;)&lt;br&gt;
  $myusername = stripslashes($myusername);&lt;br&gt;
  $mypassword = stripslashes($mypassword);&lt;br&gt;
  $myusername = mysql_real_escape_string($myusername);&lt;br&gt;
  $mypassword = mysql_real_escape_string($mypassword);&lt;/p&gt;
&lt;p&gt;$sql=&quot;SELECT * FROM $tbl_name WHERE username=&#039;$myusername&#039; and password=&#039;$mypassword&#039;&quot;;&lt;br&gt;
  $result=mysql_query($sql);&lt;/p&gt;
&lt;p&gt;// Mysql_num_row is counting table row&lt;br&gt;
  $count=mysql_num_rows($result);&lt;br&gt;
// If result matched $myusername and $mypassword, table row must be 1 row&lt;/p&gt;
&lt;p&gt;if($count==1){&lt;br&gt;
// Register $myusername, $mypassword and redirect to file &quot;login_success.php&quot;&lt;br&gt;
session_register(&quot;myusername&quot;);&lt;br&gt;
session_register(&quot;mypassword&quot;); &lt;br&gt;
header(&quot;location:login_success.php&quot;);&lt;br&gt;
}&lt;br&gt;
else {&lt;br&gt;
echo &quot;Wrong Username or Password&quot;;&lt;br&gt;
}&lt;/p&gt;
&lt;p&gt;ob_end_flush();&lt;br&gt;
?&gt;&lt;/p&gt;</pre>
</div>
<h2>Step7:</h2>
<p><strong>Encrypting Password &#8211; Make your Login More Secure</strong></p>
<p><a href="http://www.phpeasystep.com/workshopview.php?id=26"><img src="http://www.tutorialspalace.com/wp-content/uploads/2010/04/encrypt_password.gif" alt="encrypt password PHP Login Script Tutorial" width="500" height="195" border="0" title="PHP Login Script Tutorial" /></a></p>
<p><strong><a href="http://www.phpeasystep.com/workshopview.php?id=26">Read more about encrypting password here </a></strong></p>
<h2  class="related_post_title">Random Posts</h2><ul class="related_post"><li><a href="http://www.tutorialspalace.com/2011/06/to-learn-quick-photoshop-use-these-tutorials/" title="To Learn Quick Photoshop Use These Tutorials"><img src="http://www.tutorialspalace.com/wp-content/uploads/2011/06/photoshop-beginner-tutorials.jpg" alt="photoshop beginner tutorials PHP Login Script Tutorial"  title="PHP Login Script Tutorial" /></a><a href="http://www.tutorialspalace.com/2011/06/to-learn-quick-photoshop-use-these-tutorials/" title="To Learn Quick Photoshop Use These Tutorials">To Learn Quick Photoshop Use These Tutorials</a></li><li><a href="http://www.tutorialspalace.com/2009/12/luminescent-lines/" title="Luminescent Lines"><img src="http://www.tutorialspalace.com/wp-content/uploads/2009/12/lumilines-head.jpg" alt="lumilines head PHP Login Script Tutorial"  title="PHP Login Script Tutorial" /></a><a href="http://www.tutorialspalace.com/2009/12/luminescent-lines/" title="Luminescent Lines">Luminescent Lines</a></li><li><a href="http://www.tutorialspalace.com/2011/09/how-to-get-the-maximum-advantages-using-twitter/" title="How to Get the  Maximum Advantages Using Twitter"><img src="http://www.tutorialspalace.com/wp-content/uploads/2011/09/maximum-advantages-using-twitter.jpg" alt="maximum advantages using twitter PHP Login Script Tutorial"  title="PHP Login Script Tutorial" /></a><a href="http://www.tutorialspalace.com/2011/09/how-to-get-the-maximum-advantages-using-twitter/" title="How to Get the  Maximum Advantages Using Twitter">How to Get the  Maximum Advantages Using Twitter</a></li><li><a href="http://www.tutorialspalace.com/2010/01/110-the-ultimate-collection-of-maya-and-3d-max-tutorials/" title="110 The Ultimate Collection Of Maya and 3D Max Tutorials"><img src="http://www.tutorialspalace.com/wp-content/uploads/2010/01/maya-3d-tuts-head1.jpg" alt="maya 3d tuts head1 PHP Login Script Tutorial"  title="PHP Login Script Tutorial" /></a><a href="http://www.tutorialspalace.com/2010/01/110-the-ultimate-collection-of-maya-and-3d-max-tutorials/" title="110 The Ultimate Collection Of Maya and 3D Max Tutorials">110 The Ultimate Collection Of Maya and 3D Max Tutorials</a></li><li><a href="http://www.tutorialspalace.com/2009/12/glowing-beam-light-effect/" title="Glowing Beam Light Effect"><img src="http://www.tutorialspalace.com/wp-content/uploads/2009/12/glowingbeam1.jpg" alt="glowingbeam1 PHP Login Script Tutorial"  title="PHP Login Script Tutorial" /></a><a href="http://www.tutorialspalace.com/2009/12/glowing-beam-light-effect/" title="Glowing Beam Light Effect">Glowing Beam Light Effect</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.tutorialspalace.com/2010/07/php-login-script-tutorial/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Simple PHP Contact Form Tutorial</title>
		<link>http://www.tutorialspalace.com/2010/05/simple-php-contact-form-tutorial/</link>
		<comments>http://www.tutorialspalace.com/2010/05/simple-php-contact-form-tutorial/#comments</comments>
		<pubDate>Tue, 25 May 2010 06:11:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Contact Form Tutorial]]></category>
		<category><![CDATA[PHP Contact Form Tutorial]]></category>
		<category><![CDATA[Simple Contact Form Tutorial]]></category>

		<guid isPermaLink="false">http://www.tutorialspalace.com/?p=2794</guid>
		<description><![CDATA[When you need that user contact with you or send feedback to you via email then you have to need make a contact form. In this tutorial you will learn that how to create form with php script. Overview In this tutorial create 2 files 1. contact.php and 2. send_contact.php Step 1. Create file contact.php. [...]]]></description>
			<content:encoded><![CDATA[<p>When you need that user contact with you or send feedback to you via email then you have to need make a contact form. In this tutorial you will learn that how to create form with php script.</p>
<p><span id="more-2794"></span></p>
<p><strong>Overview</strong></p>
<p>In this tutorial create  2 files  1. contact.php  and   2. send_contact.php </p>
<p>  Step<br />
  1. Create file contact.php.<br />
  2. Create file send_contact.php.</p>
<h2>Step1:</h2>
<p><strong>Create file contact.php</strong></p>
<p><img src="http://www.tutorialspalace.com/wp-content/uploads/2010/04/contact_form.gif" alt="contact form Simple PHP Contact Form Tutorial" width="420" height="269" title="Simple PHP Contact Form Tutorial" /><br />
View In Browser</p>
<p><strong>|&#8212;|&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; code &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;|&#8212;|</strong></p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
</pre>
<pre>&lt;p&gt;&lt;table
  width=&quot;400&quot; border=&quot;0&quot; align=&quot;center&quot; cellpadding=&quot;3&quot;
  cellspacing=&quot;1&quot;&gt;&lt;br&gt;
  &lt;tr&gt;&lt;br&gt;
  &lt;td&gt;&lt;strong&gt;Contact Form &lt;/strong&gt;&lt;/td&gt;&lt;br&gt;
  &lt;/tr&gt;&lt;br&gt;
  &lt;/table&gt;&lt;/p&gt;
&lt;p&gt;&lt;table
  width=&quot;400&quot; border=&quot;0&quot; align=&quot;center&quot; cellpadding=&quot;0&quot;
  cellspacing=&quot;1&quot;&gt;&lt;br&gt;
  &lt;tr&gt;&lt;br&gt;
  &lt;td&gt;&lt;form name=&quot;form1&quot; method=&quot;post&quot;
  action=&quot;send_contact.php&quot;&gt;&lt;br&gt;
  &lt;table width=&quot;100%&quot; border=&quot;0&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot;&gt;&lt;br&gt;
  &lt;tr&gt;&lt;br&gt;
  &lt;td width=&quot;16%&quot;&gt;Subject&lt;/td&gt;&lt;br&gt;
  &lt;td width=&quot;2%&quot;&gt;:&lt;/td&gt;&lt;br&gt;
  &lt;td width=&quot;82%&quot;&gt;&lt;input name=&quot;subject&quot; type=&quot;text&quot;
  id=&quot;subject&quot; size=&quot;50&quot;&gt;&lt;/td&gt;&lt;br&gt;
  &lt;/tr&gt;&lt;br&gt;
  &lt;tr&gt;&lt;br&gt;
  &lt;td&gt;Detail&lt;/td&gt;&lt;br&gt;
  &lt;td&gt;:&lt;/td&gt;&lt;br&gt;
  &lt;td&gt;&lt;textarea name=&quot;detail&quot; cols=&quot;50&quot; rows=&quot;4&quot;
  id=&quot;detail&quot;&gt;&lt;/textarea&gt;&lt;/td&gt;&lt;br&gt;
  &lt;/tr&gt;&lt;br&gt;
  &lt;tr&gt;&lt;br&gt;
  &lt;td&gt;Name&lt;/td&gt;&lt;br&gt;
  &lt;td&gt;:&lt;/td&gt;&lt;br&gt;
  &lt;td&gt;&lt;input name=&quot;name&quot; type=&quot;text&quot; id=&quot;name&quot;
  size=&quot;50&quot;&gt;&lt;/td&gt;&lt;br&gt;
  &lt;/tr&gt;&lt;br&gt;
  &lt;tr&gt;&lt;br&gt;
  &lt;td&gt;Email&lt;/td&gt;&lt;br&gt;
  &lt;td&gt;:&lt;/td&gt;&lt;br&gt;
  &lt;td&gt;&lt;input name=&quot;customer_mail&quot; type=&quot;text&quot;
  id=&quot;customer_mail&quot; size=&quot;50&quot;&gt;&lt;/td&gt;&lt;br&gt;
  &lt;/tr&gt;&lt;br&gt;
  &lt;tr&gt;&lt;br&gt;
  &lt;td&gt;&nbsp;&lt;/td&gt;&lt;br&gt;
  &lt;td&gt;&nbsp;&lt;/td&gt;&lt;br&gt;
  &lt;td&gt;&lt;input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;Submit&quot;&gt;
  &lt;input type=&quot;reset&quot; name=&quot;Submit2&quot; value=&quot;Reset&quot;&gt;&lt;/td&gt;&lt;br&gt;
  &lt;/tr&gt;&lt;br&gt;
  &lt;/table&gt;&lt;br&gt;
  &lt;/form&gt;&lt;br&gt;
  &lt;/td&gt;&lt;br&gt;
  &lt;/tr&gt;&lt;br&gt;
  &lt;/table&gt;&lt;/p&gt;</pre>
</div>
<p><strong></p>
<h2>Step2:</h2>
<p>Create file send_contact.php</p>
<p>|&#8212;|&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; code &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;|&#8212;|</strong></p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
</pre>
<pre>&lt;p&gt;&lt;?php&lt;br&gt;
// Contact subject&lt;br&gt;
  $subject =&quot;$subject&quot;; &lt;br&gt;
// Details&lt;br&gt;
$message=&quot;$detail&quot;; &lt;/p&gt;
&lt;p&gt;// Mail of sender&lt;br&gt;
  $mail_from=&quot;$customer_mail&quot;; &lt;br&gt;
// From &lt;br&gt;
  $header=&quot;from:
  $name &lt;$mail_from&gt;&quot;; &lt;/p&gt;
&lt;p&gt;// Enter your email address&lt;br&gt;
  $to =&#039;someone@somewhere.com&#039;; &lt;/p&gt;
&lt;p&gt;$send_contact=mail($to,$subject,$message,$header);&lt;/p&gt;
&lt;p&gt;// Check, if  message sent to your email &lt;br&gt;
&quot;We&#039;ve recived your information&quot;&lt;br&gt;
if($send_contact){&lt;br&gt;
echo &quot;We&#039;ve recived your contact information&quot;;&lt;br&gt;
}&lt;br&gt;
else {&lt;br&gt;
echo &quot;ERROR&quot;;&lt;br&gt;
}&lt;br&gt;
?&gt;&lt;/p&gt;</pre>
</div>
<h2  class="related_post_title">Random Posts</h2><ul class="related_post"><li><a href="http://www.tutorialspalace.com/2011/06/limit-displayed-characters-from-your-text/" title="Limit Displayed Characters From Your Text"><img src="http://www.tutorialspalace.com/wp-content/uploads/2010/04/text-limit-tut-head.jpg" alt="text limit tut head Simple PHP Contact Form Tutorial"  title="Simple PHP Contact Form Tutorial" /></a><a href="http://www.tutorialspalace.com/2011/06/limit-displayed-characters-from-your-text/" title="Limit Displayed Characters From Your Text">Limit Displayed Characters From Your Text</a></li><li><a href="http://www.tutorialspalace.com/2009/12/50-beautiful-christmas-photoshop-tutorials/" title="50+ Beautiful Christmas Photoshop Tutorials"><img src="http://www.tutorialspalace.com/wp-content/uploads/2009/12/chris-tuts2-head.jpg" alt="chris tuts2 head Simple PHP Contact Form Tutorial"  title="Simple PHP Contact Form Tutorial" /></a><a href="http://www.tutorialspalace.com/2009/12/50-beautiful-christmas-photoshop-tutorials/" title="50+ Beautiful Christmas Photoshop Tutorials">50+ Beautiful Christmas Photoshop Tutorials</a></li><li><a href="http://www.tutorialspalace.com/2010/12/get-width-and-height-of-an-image-in-php/" title="Get Width and Height of an Image in PHP"><img src="http://www.tutorialspalace.com/wp-content/uploads/2010/04/php-get-dims-head.jpg" alt="php get dims head Simple PHP Contact Form Tutorial"  title="Simple PHP Contact Form Tutorial" /></a><a href="http://www.tutorialspalace.com/2010/12/get-width-and-height-of-an-image-in-php/" title="Get Width and Height of an Image in PHP">Get Width and Height of an Image in PHP</a></li><li><a href="http://www.tutorialspalace.com/2010/09/50-photoshop-illustrator-effects-and-tutorials/" title="50 Photoshop Illustrator Effects and Tutorials"><img src="http://www.tutorialspalace.com/wp-content/uploads/2010/02/tuts-illustrator50-head.jpg" alt="tuts illustrator50 head Simple PHP Contact Form Tutorial"  title="Simple PHP Contact Form Tutorial" /></a><a href="http://www.tutorialspalace.com/2010/09/50-photoshop-illustrator-effects-and-tutorials/" title="50 Photoshop Illustrator Effects and Tutorials">50 Photoshop Illustrator Effects and Tutorials</a></li><li><a href="http://www.tutorialspalace.com/2012/01/best-ever-web-layout-designs-photoshop-tutorials/" title="Best Ever Web Layout Designs Photoshop Tutorials"><img src="http://www.tutorialspalace.com/wp-content/uploads/2012/01/web-designs-photoshop-tutorials.jpg" alt="web designs photoshop tutorials Simple PHP Contact Form Tutorial"  title="Simple PHP Contact Form Tutorial" /></a><a href="http://www.tutorialspalace.com/2012/01/best-ever-web-layout-designs-photoshop-tutorials/" title="Best Ever Web Layout Designs Photoshop Tutorials">Best Ever Web Layout Designs Photoshop Tutorials</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.tutorialspalace.com/2010/05/simple-php-contact-form-tutorial/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>PHP Upload Single File</title>
		<link>http://www.tutorialspalace.com/2010/04/php-upload-single-file/</link>
		<comments>http://www.tutorialspalace.com/2010/04/php-upload-single-file/#comments</comments>
		<pubDate>Mon, 26 Apr 2010 09:09:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP File Upload Script]]></category>
		<category><![CDATA[PHP File Upload Tutorial]]></category>
		<category><![CDATA[PHP Script]]></category>
		<category><![CDATA[PHP Tutorial]]></category>

		<guid isPermaLink="false">http://www.tutorialspalace.com/?p=2750</guid>
		<description><![CDATA[This is a simple PHP uploading file tutorial. You can upload files on your server through this script. Overview In this tutorial create 2 files 1. upload.php 2. upload_ac.php Step 1. Create file upload.php. 2. Create file upload_ac.php. 3. Create folder &#8220;upload&#8221; for store uploaded files. 4. CHMOD your upload folder to &#8220;777&#8243; by using [...]]]></description>
			<content:encoded><![CDATA[<p>This is a simple PHP uploading file tutorial. You can upload files on your server through this script. </p>
<p><span id="more-2750"></span></p>
<p><strong>Overview</strong></p>
<p>In this tutorial create 2 files<br />
  1. upload.php <br />
  2. upload_ac.php</p>
<p>
  Step <br />
  1. Create file upload.php.<br />
  2. Create file upload_ac.php.<br />
  3. Create folder &#8220;upload&#8221; for store uploaded files.<br />
  4. CHMOD your upload folder to &#8220;777&#8243; by using your ftp software(change permission). </p>
<h2>Step1:</h2>
<p><strong>Create file upload.php </strong></p>
<p><img src="http://www.tutorialspalace.com/wp-content/uploads/2010/04/single_file_upload.gif" alt="single file upload PHP Upload Single File" width="525" height="106" title="PHP Upload Single File" /></p>
<p><strong>|&#8212;|&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; code &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;|&#8212;|</strong></p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
</pre>
<pre>&lt;table width=&quot;500&quot; border=&quot;0&quot; align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;1&quot; bgcolor=&quot;#CCCCCC&quot;&gt;&lt;br&gt;
  &lt;tr&gt;&lt;br&gt;
  &lt;form action=&quot;upload_ac.php&quot; method=&quot;post&quot; enctype=&quot;multipart/form-data&quot; name=&quot;form1&quot; id=&quot;form1&quot;&gt;&lt;br&gt;
  &lt;td&gt;&lt;br&gt;
  &lt;table width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;3&quot; cellspacing=&quot;1&quot; bgcolor=&quot;#FFFFFF&quot;&gt;&lt;br&gt;
  &lt;tr&gt;&lt;br&gt;
  &lt;td&gt;&lt;strong&gt;Single File Upload &lt;/strong&gt;&lt;/td&gt;&lt;br&gt;
  &lt;/tr&gt;&lt;br&gt;
  &lt;tr&gt;&lt;br&gt;
  &lt;td&gt;Select file &lt;br&gt;
  &lt;input name=&quot;ufile&quot; type=&quot;file&quot; id=&quot;ufile&quot; size=&quot;50&quot; /&gt;&lt;/td&gt;&lt;br&gt;
  &lt;/tr&gt;&lt;br&gt;
  &lt;tr&gt;&lt;br&gt;
  &lt;td align=&quot;center&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;Upload&quot; /&gt;&lt;/td&gt;&lt;br&gt;
  &lt;/tr&gt;&lt;br&gt;
  &lt;/table&gt;&lt;br&gt;
  &lt;/td&gt;&lt;br&gt;
  &lt;/form&gt;&lt;br&gt;
  &lt;/tr&gt;&lt;br&gt;
  &lt;/table&gt;&lt;/p&gt;</pre>
</div>
<p><h2>Step2:</h2>
<p><strong>Create file upload_ac.php</strong></p>
<p><strong>|&#8212;|&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; code &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;|&#8212;|</strong></p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
</pre>
<pre>&lt;p&gt;&lt;?php&lt;br&gt;
//set where you want to store files&lt;br&gt;
//in this example we keep file in folder upload &lt;br&gt;
//$HTTP_POST_FILES[&#039;ufile&#039;][&#039;name&#039;]; = upload file name&lt;br&gt;
//for example upload file name cartoon.gif . $path will be upload/cartoon.gif&lt;br&gt;
  $path= &quot;upload/&quot;.$HTTP_POST_FILES[&#039;ufile&#039;][&#039;name&#039;];&lt;br&gt;
  if($ufile !=none)&lt;br&gt;
  {&lt;br&gt;
  if(copy($HTTP_POST_FILES[&#039;ufile&#039;][&#039;tmp_name&#039;], $path))&lt;br&gt;
  {&lt;br&gt;
  echo &quot;Successful&lt;BR/&gt;&quot;; &lt;/p&gt;
&lt;p&gt;//$HTTP_POST_FILES[&#039;ufile&#039;][&#039;name&#039;] = file name&lt;br&gt;
//$HTTP_POST_FILES[&#039;ufile&#039;][&#039;size&#039;] = file size&lt;br&gt;
//$HTTP_POST_FILES[&#039;ufile&#039;][&#039;type&#039;] = type of file&lt;br&gt;
  echo &quot;File Name :&quot;.$HTTP_POST_FILES[&#039;ufile&#039;][&#039;name&#039;].&quot;&lt;BR/&gt;&quot;; &lt;br&gt;
  echo &quot;File Size :&quot;.$HTTP_POST_FILES[&#039;ufile&#039;][&#039;size&#039;].&quot;&lt;BR/&gt;&quot;; &lt;br&gt;
  echo &quot;File Type :&quot;.$HTTP_POST_FILES[&#039;ufile&#039;][&#039;type&#039;].&quot;&lt;BR/&gt;&quot;; &lt;br&gt;
  echo &quot;&lt;img src=\&quot;$path\&quot; width=\&quot;150\&quot; height=\&quot;150\&quot;&gt;&quot;;&lt;br&gt;
  }&lt;br&gt;
  else&lt;br&gt;
  {&lt;br&gt;
  echo &quot;Error&quot;;&lt;br&gt;
  }&lt;br&gt;
  }&lt;br&gt;
  ?&gt;&lt;/p&gt;</pre>
</div>
<h2>Step3:</h2>
<p><strong>CHMOD upload folder to 777 (change permission) </strong></p>
<p>This step, do it when you upload to real server. This example, I use CuteFTP, right click at upload folder &gt; FTP Commands &gt; CHMOD
</p>
<p><img src="http://www.tutorialspalace.com/wp-content/uploads/2010/04/rfp.gif" alt="rfp PHP Upload Single File" width="235" height="203" title="PHP Upload Single File" /></p>
<h2  class="related_post_title">Related Articles</h2><ul class="related_post"><li><a href="http://www.tutorialspalace.com/2011/06/upload-and-rename-file-php-tutorial/" title="Upload and Rename File PHP Tutorial"><img src="http://www.tutorialspalace.com/wp-content/uploads/2010/04/php-up-ren-head.jpg" alt="php up ren head PHP Upload Single File"  title="PHP Upload Single File" /></a><a href="http://www.tutorialspalace.com/2011/06/upload-and-rename-file-php-tutorial/" title="Upload and Rename File PHP Tutorial">Upload and Rename File PHP Tutorial</a></li><li><a href="http://www.tutorialspalace.com/2011/05/php-encryptions-tutorial/" title="PHP Encryptions Tutorial"><img src="http://www.tutorialspalace.com/wp-content/uploads/2011/05/php-encryption.jpg" alt="php encryption PHP Upload Single File"  title="PHP Upload Single File" /></a><a href="http://www.tutorialspalace.com/2011/05/php-encryptions-tutorial/" title="PHP Encryptions Tutorial">PHP Encryptions Tutorial</a></li><li><a href="http://www.tutorialspalace.com/2011/03/alternating-table-row-colors/" title="Alternating Table Row Colors"><img src="http://www.tutorialspalace.com/wp-content/uploads/2010/04/php-alter-tbl-head.jpg" alt="php alter tbl head PHP Upload Single File"  title="PHP Upload Single File" /></a><a href="http://www.tutorialspalace.com/2011/03/alternating-table-row-colors/" title="Alternating Table Row Colors">Alternating Table Row Colors</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.tutorialspalace.com/2010/04/php-upload-single-file/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>

