<?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>PHP/MySQL | Student Projects</title>
	<atom:link href="https://studentprojects.in/category/software-development/php-mysql/feed/" rel="self" type="application/rss+xml" />
	<link>https://studentprojects.in</link>
	<description>Microcontroller projects, Circuit Diagrams, Project Ideas</description>
	<lastBuildDate>Sat, 10 Dec 2022 05:33:01 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.7</generator>
	<item>
		<title>How to run PHP files on a local computer using XAMPP</title>
		<link>https://studentprojects.in/software-development/php-mysql/php-tutorial/how-to-run-php-files-on-a-local-computer-using-xampp/</link>
					<comments>https://studentprojects.in/software-development/php-mysql/php-tutorial/how-to-run-php-files-on-a-local-computer-using-xampp/#respond</comments>
		
		<dc:creator><![CDATA[Ranjith Kadamboor]]></dc:creator>
		<pubDate>Thu, 07 Apr 2022 02:40:36 +0000</pubDate>
				<category><![CDATA[PHP Tutorial]]></category>
		<category><![CDATA[XAMPP]]></category>
		<category><![CDATA[php localhost]]></category>
		<category><![CDATA[phpMyAdmin]]></category>
		<guid isPermaLink="false">https://studentprojects.in/?p=8939</guid>

					<description><![CDATA[<p>To run a PHP, it is enough to just install an Apache server on your local computer. In most PHP projects, MySQL is used as a database. PHPMyAdmin is required to manage the database. All are separate open-source software and installing this software one by one will be a difficult job for beginners. This is</p>
<p>The post <a href="https://studentprojects.in/software-development/php-mysql/php-tutorial/how-to-run-php-files-on-a-local-computer-using-xampp/">How to run PHP files on a local computer using XAMPP</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>To run a PHP, it is enough to just install an Apache server on your local computer. In most PHP projects, MySQL is used as a database. PHPMyAdmin is required to manage the database. All are separate open-source software and installing this software one by one will be a difficult job for beginners. This is where XAMPP comes into the picture. &nbsp;XAMPP is an easy to install Apache distribution containing Apache web server, PHP and MySQL bundled together.&nbsp;</p>



<p>Download XAMPP from <a href="https://www.apachefriends.org/index.html" target="_blank" rel="noopener">XAMPP&#8217;s official website</a>. Select your operating system and click on the download button.</p>



<div class="wp-block-image wp-image-8770 size-full"><figure class="aligncenter"><img decoding="async" width="800" height="479" src="https://studentprojects.in/wp-content/uploads/2011/01/XAMPP-Setup.jpg" alt="Download XAMPP from XAMPP's official website" class="wp-image-8770" srcset="https://studentprojects.in/wp-content/uploads/2011/01/XAMPP-Setup.jpg 800w, https://studentprojects.in/wp-content/uploads/2011/01/XAMPP-Setup-300x180.jpg 300w, https://studentprojects.in/wp-content/uploads/2011/01/XAMPP-Setup-768x460.jpg 768w" sizes="(max-width: 800px) 100vw, 800px" /><figcaption>Download XAMPP from XAMPP&#8217;s official website.</figcaption></figure></div>



<p>Wait a few moments after hitting the download button. Because the file is around 150 MB in size, it will take some time to download. After downloading the file, double click the executable file and follow the installation process.&nbsp;</p>



<div class="wp-block-image size-full wp-image-8774"><figure class="aligncenter"><img decoding="async" loading="lazy" width="502" height="425" src="https://studentprojects.in/wp-content/uploads/2011/01/01-Xampp-setup-on-Windows.png" alt="Xampp setup on Windows" class="wp-image-8774" srcset="https://studentprojects.in/wp-content/uploads/2011/01/01-Xampp-setup-on-Windows.png 502w, https://studentprojects.in/wp-content/uploads/2011/01/01-Xampp-setup-on-Windows-300x254.png 300w" sizes="(max-width: 502px) 100vw, 502px" /><figcaption>XAMPP serve setup on Windows</figcaption></figure></div>



<p>Click on the Next button.</p>



<div class="wp-block-image size-full wp-image-8775"><figure class="aligncenter"><img decoding="async" loading="lazy" width="502" height="425" src="https://studentprojects.in/wp-content/uploads/2011/01/02-Xampp-server-setup-on-Windows.png" alt="Xampp server setup on Windows" class="wp-image-8775" srcset="https://studentprojects.in/wp-content/uploads/2011/01/02-Xampp-server-setup-on-Windows.png 502w, https://studentprojects.in/wp-content/uploads/2011/01/02-Xampp-server-setup-on-Windows-300x254.png 300w" sizes="(max-width: 502px) 100vw, 502px" /><figcaption>Select the required components to install</figcaption></figure></div>



<p>On this screen, some of the checkboxes will already be checked. It is enough to select Apache, MySQL, PHP and phpMyAdmin and click on the Next button. On the next screen, select the path where you want to install the XAMPP server. You can leave it as default c:\xampp. Click on the Next button.</p>



<div class="wp-block-image size-full wp-image-8776"><figure class="aligncenter"><img decoding="async" loading="lazy" width="502" height="425" src="https://studentprojects.in/wp-content/uploads/2011/01/03-Xampp-installation-on-Windows.png" alt="Xampp installation on Windows" class="wp-image-8776" srcset="https://studentprojects.in/wp-content/uploads/2011/01/03-Xampp-installation-on-Windows.png 502w, https://studentprojects.in/wp-content/uploads/2011/01/03-Xampp-installation-on-Windows-300x254.png 300w" sizes="(max-width: 502px) 100vw, 502px" /><figcaption>Xampp installation is in progress</figcaption></figure></div>



<div class="wp-block-image size-full wp-image-8795"><figure class="aligncenter"><img decoding="async" loading="lazy" width="502" height="425" src="https://studentprojects.in/wp-content/uploads/2011/01/Start-Xampp-server.png" alt="Start Xampp server" class="wp-image-8795" srcset="https://studentprojects.in/wp-content/uploads/2011/01/Start-Xampp-server.png 502w, https://studentprojects.in/wp-content/uploads/2011/01/Start-Xampp-server-300x254.png 300w" sizes="(max-width: 502px) 100vw, 502px" /><figcaption>Remove the tick mark and click the finish button</figcaption></figure></div>



<p>Once the installation is complete, remove the tick mark &#8220;Do you want to start the control panel now?&#8221; and click on the Finish button. We have to run the XAMPP control panel as administrators.</p>



<h3>Step 2 &#8211; Run the XAMPP server and test it</h3>



<p>Once the XAMPP installation is complete, you will need to run XAMPP as an administrator on Windows. To do that, click Start, find XAMPP Control Panel in your Programs list, then right-click and select Run As Administrator. Another option is to go to C:/xampp where you have installed the XAMPP server, run xampp_start.exe as administrator.</p>



<div class="wp-block-image size-full wp-image-8777"><figure class="aligncenter"><img decoding="async" loading="lazy" width="824" height="687" src="https://studentprojects.in/wp-content/uploads/2011/01/04-Run-xampp-as-administrator.png" alt="Run xampp as administrator" class="wp-image-8777" srcset="https://studentprojects.in/wp-content/uploads/2011/01/04-Run-xampp-as-administrator.png 824w, https://studentprojects.in/wp-content/uploads/2011/01/04-Run-xampp-as-administrator-300x250.png 300w, https://studentprojects.in/wp-content/uploads/2011/01/04-Run-xampp-as-administrator-768x640.png 768w" sizes="(max-width: 824px) 100vw, 824px" /><figcaption>Run XAMPP as administrator</figcaption></figure></div>



<p>This will launch the XAMPP Control Panel.</p>



<div class="wp-block-image size-full wp-image-8778"><figure class="aligncenter"><img decoding="async" loading="lazy" width="668" height="434" src="https://studentprojects.in/wp-content/uploads/2011/01/05-Run-Apache-and-MySql-server-on-windows-xampp.png" alt="Run Apache and MySql server on windows xampp" class="wp-image-8778" srcset="https://studentprojects.in/wp-content/uploads/2011/01/05-Run-Apache-and-MySql-server-on-windows-xampp.png 668w, https://studentprojects.in/wp-content/uploads/2011/01/05-Run-Apache-and-MySql-server-on-windows-xampp-300x195.png 300w" sizes="(max-width: 668px) 100vw, 668px" /><figcaption>XAMPP Control Panel</figcaption></figure></div>



<p>First, run Apache and MySQL services on the left side of the Control panel. Observe the green tick mark. This will register the Apache and MySQL server as service and it will start the server on every system reboot. Now click on the Start button for both Apache and MySQL which should look like the below image.&nbsp;&nbsp;You can track the green running status near to it.</p>



<div class="wp-block-image size-full wp-image-8779"><figure class="aligncenter"><img decoding="async" loading="lazy" width="668" height="434" src="https://studentprojects.in/wp-content/uploads/2011/01/06-Configure-Apache-and-MySql-server-on-localhost.png" alt="Configure Apache and MySql server on localhost" class="wp-image-8779" srcset="https://studentprojects.in/wp-content/uploads/2011/01/06-Configure-Apache-and-MySql-server-on-localhost.png 668w, https://studentprojects.in/wp-content/uploads/2011/01/06-Configure-Apache-and-MySql-server-on-localhost-300x195.png 300w" sizes="(max-width: 668px) 100vw, 668px" /><figcaption>Start Apache &amp; MySQL in the XAMPP Control Panel</figcaption></figure></div>



<p>Now is the time to test the XAMPP server. Open http://localhost, if everything is good then it should open the page like the below image.&nbsp;</p>



<div class="wp-block-image size-full wp-image-8780"><figure class="aligncenter"><img decoding="async" loading="lazy" width="1074" height="658" src="https://studentprojects.in/wp-content/uploads/2011/01/07-Testing-XAMPP-on-localhost.png" alt="Testing XAMPP on localhost" class="wp-image-8780" srcset="https://studentprojects.in/wp-content/uploads/2011/01/07-Testing-XAMPP-on-localhost.png 1074w, https://studentprojects.in/wp-content/uploads/2011/01/07-Testing-XAMPP-on-localhost-300x184.png 300w, https://studentprojects.in/wp-content/uploads/2011/01/07-Testing-XAMPP-on-localhost-1024x627.png 1024w, https://studentprojects.in/wp-content/uploads/2011/01/07-Testing-XAMPP-on-localhost-768x471.png 768w" sizes="(max-width: 1074px) 100vw, 1074px" /><figcaption>Testing XAMPP on localhost</figcaption></figure></div>



<p>Create your project folder inside C:/xampp/htdocs and upload the files. For example, create a folder called &#8220;project&#8221; inside C:/xampp/htdocs and upload a sample PHP file. Now go to the browser and open http://localhost/project. PHP file should open properly. </p>



<h3>Creating a Database</h3>



<p>We will create a MySQL database using the phpMyAdmin tool. Open http://localhost/phpmyadmin to launch phpMyAdmin. </p>



<div class="wp-block-image size-full wp-image-8783"><figure class="aligncenter"><img decoding="async" loading="lazy" width="1073" height="476" src="https://studentprojects.in/wp-content/uploads/2011/01/10-phpmyadmin-setup-on-localhost.png" alt="phpmyadmin setup on localhost" class="wp-image-8783" srcset="https://studentprojects.in/wp-content/uploads/2011/01/10-phpmyadmin-setup-on-localhost.png 1073w, https://studentprojects.in/wp-content/uploads/2011/01/10-phpmyadmin-setup-on-localhost-300x133.png 300w, https://studentprojects.in/wp-content/uploads/2011/01/10-phpmyadmin-setup-on-localhost-1024x454.png 1024w, https://studentprojects.in/wp-content/uploads/2011/01/10-phpmyadmin-setup-on-localhost-768x341.png 768w" sizes="(max-width: 1073px) 100vw, 1073px" /><figcaption>PHPMyAdmin setup on localhost</figcaption></figure></div>



<p>Click on the tab Databases, enter the database name and click on create button. This will create a database.&nbsp;You can name the database whatever you want.</p>



<p>So, give it a shot and let me know if you have any questions in the comments section below. I’ll be happy to assist you!</p><p>The post <a href="https://studentprojects.in/software-development/php-mysql/php-tutorial/how-to-run-php-files-on-a-local-computer-using-xampp/">How to run PHP files on a local computer using XAMPP</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/php-mysql/php-tutorial/how-to-run-php-files-on-a-local-computer-using-xampp/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to redirect page using PHP with values?</title>
		<link>https://studentprojects.in/software-development/php-mysql/php-tutorial/redirect-page-php-values/</link>
					<comments>https://studentprojects.in/software-development/php-mysql/php-tutorial/redirect-page-php-values/#comments</comments>
		
		<dc:creator><![CDATA[Peter Vegas]]></dc:creator>
		<pubDate>Mon, 02 Jan 2012 10:44:07 +0000</pubDate>
				<category><![CDATA[PHP Tutorial]]></category>
		<category><![CDATA[php redirect]]></category>
		<category><![CDATA[html redirect]]></category>
		<category><![CDATA[header redirect]]></category>
		<category><![CDATA[send vlues to redirect]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=2515</guid>

					<description><![CDATA[<p>Here is the code for simple PHP page redirect. The search engine friendly way of redirecting is the 301 redirect. Note that if you do not include the first Header line above, the redirect still works. But, instead of a 301 redirect, now it becomes a 302 (temporary) redirect. Now if you want to redirect</p>
<p>The post <a href="https://studentprojects.in/software-development/php-mysql/php-tutorial/redirect-page-php-values/">How to redirect page using PHP with values?</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Here is the code for simple PHP page redirect. The search engine friendly way of redirecting is the 301 redirect.</p>
<pre lang="php" line="1"><!--?php
	Header("HTTP/1.1 301 Moved Permanently"); 
	header( 'Location: http://www.yoursite.com/page.html' ) ;
?-->
</pre>
<p>Note that if you do not include the first Header line above, the redirect still works. But, instead of a 301 redirect, now it becomes a 302 (temporary) redirect.</p>
<p>Now if you want to redirect to perticluer user page then you need to include user id in the url. Here is the code:</p>
<pre lang="php" line="1"><!--?php
	header("Location: userpage.php?id=".$userId);
?-->
</pre><p>The post <a href="https://studentprojects.in/software-development/php-mysql/php-tutorial/redirect-page-php-values/">How to redirect page using PHP with values?</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/php-mysql/php-tutorial/redirect-page-php-values/feed/</wfw:commentRss>
			<slash:comments>68</slash:comments>
		
		
			</item>
		<item>
		<title>How to resize image using php?</title>
		<link>https://studentprojects.in/software-development/php-mysql/php-tutorial/resize-image-php/</link>
					<comments>https://studentprojects.in/software-development/php-mysql/php-tutorial/resize-image-php/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Thu, 01 Sep 2011 10:10:34 +0000</pubDate>
				<category><![CDATA[PHP Tutorial]]></category>
		<category><![CDATA[php script]]></category>
		<category><![CDATA[image resize]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1805</guid>

					<description><![CDATA[<p>Here is a simple script to resize the given image. This requires PHP5, GD library. First download the file and include to your code. Usage example:</p>
<p>The post <a href="https://studentprojects.in/software-development/php-mysql/php-tutorial/resize-image-php/">How to resize image using php?</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Here is a simple script to resize the given image. This requires PHP5, GD library. </p>
<p>First <a href="https://studentprojects.in/wp-content/uploads/2011/09/resize-class.zip">download the file</a> and include to your code. </p>
<p><strong>Usage example:</strong></p>
<pre lang="php" escaped="true" line="1">
<?php
// *** Include the class
include("resize-class.php");

// *** 1) Initialise / load image
$resizeObj = new resize('sample.jpg');

// *** 2) Resize image (options: exact, portrait, landscape, auto, crop)
$resizeObj -> resizeImage(200, 200, 'crop');
// *** 3) Save image
$resizeObj -> saveImage('sample-resized.jpg', 100);
?>
</pre><p>The post <a href="https://studentprojects.in/software-development/php-mysql/php-tutorial/resize-image-php/">How to resize image using php?</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/php-mysql/php-tutorial/resize-image-php/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>How to Extract or Unzip files from a .zip file using PHP</title>
		<link>https://studentprojects.in/software-development/php-mysql/php-tutorial/extract-unzip-files-zip-file-php/</link>
					<comments>https://studentprojects.in/software-development/php-mysql/php-tutorial/extract-unzip-files-zip-file-php/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Thu, 01 Sep 2011 08:40:51 +0000</pubDate>
				<category><![CDATA[PHP Tutorial]]></category>
		<category><![CDATA[extract files]]></category>
		<category><![CDATA[unzip usng php]]></category>
		<category><![CDATA[pclzip.lib]]></category>
		<category><![CDATA[php extract]]></category>
		<category><![CDATA[no library]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1791</guid>

					<description><![CDATA[<p>Here is the simple code which will extract a zip file. Here we are using pclzip.lib file to extract files. You no need to install any other library to your server. First download pclzip.lib file. Now use the below code to extract your zip file. unzip &#124; studentprojects.in</p>
<p>The post <a href="https://studentprojects.in/software-development/php-mysql/php-tutorial/extract-unzip-files-zip-file-php/">How to Extract or Unzip files from a .zip file using PHP</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Here is the simple code which will extract a zip file. Here we are using pclzip.lib file to extract files. You no need to install any other library to your server. </p>
<p>First download <a href="https://studentprojects.in/wp-content/uploads/2011/09/pclzip.lib_.zip">pclzip.lib</a> file.</p>
<p>Now use the below code to extract your zip file. </p>
<pre lang="php" escaped="true" line="1">
<html>
<head><title>unzip | studentprojects.in</title>
</head>
<body>
<?php	
require_once('pclzip.lib.php'); 
$zipfile = new PclZip('filename.zip');
if ($zipfile -> extract() == 0) {
	echo 'Error : ' . $zipfile -> errorInfo(true);
}else{
	echo 'File Extracted!';
} 
?>
</body>
</html>

</pre><p>The post <a href="https://studentprojects.in/software-development/php-mysql/php-tutorial/extract-unzip-files-zip-file-php/">How to Extract or Unzip files from a .zip file using PHP</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/php-mysql/php-tutorial/extract-unzip-files-zip-file-php/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>How to upload image to database using PHP/MySQL</title>
		<link>https://studentprojects.in/software-development/php-mysql/php-mysql-tutorials/upload-image-database-phpmysql/</link>
					<comments>https://studentprojects.in/software-development/php-mysql/php-mysql-tutorials/upload-image-database-phpmysql/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Thu, 01 Sep 2011 07:42:36 +0000</pubDate>
				<category><![CDATA[PHP & MySQL Tutorials]]></category>
		<category><![CDATA[php upload file]]></category>
		<category><![CDATA[mysql upload file]]></category>
		<category><![CDATA[store file in sql]]></category>
		<category><![CDATA[$_files]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1792</guid>

					<description><![CDATA[<p>Here is the simple code to upload files to a particular folder also this will make an entry in database. For example if you are making user registration, this code can be used to store user photo. Use the same user table to store user image. In this code we have used &#8220;file_tbl&#8221; table to</p>
<p>The post <a href="https://studentprojects.in/software-development/php-mysql/php-mysql-tutorials/upload-image-database-phpmysql/">How to upload image to database using PHP/MySQL</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Here is the simple code to upload files to a particular folder also this will make an entry in database. For example if you are making user registration, this code can be used to store user photo. Use the same user table to store user image. </p>
<p>In this code we have used &#8220;file_tbl&#8221; table to store user image path. Change the table and database name. </p>
<p><strong>SQL dump: </strong></p>
<pre lang="sql" escaped="true" line="1">
--
-- Table structure for table `file_tbl`
--

CREATE TABLE IF NOT EXISTS `file_tbl` (
  `id` int(11) NOT NULL auto_increment,
  `path` varchar(200) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
</pre>
<p><strong>PHP file:</strong></p>
<pre lang="php" escaped="true" line="1">
<form action="" method="post" enctype="multipart/form-data">
<input type="file" name="image" id="image" size="40">
<input name="" type="submit" value="upload" />

</form>
<?php 
$con = mysql_connect('localhost', 'root', ''); //Update hostname
mysql_select_db("my_db", $con); //Update database name

define ("MAX_SIZE","1000"); 
function getExtension($str)
{
	 $i = strrpos($str,".");
	 if (!$i) { return ""; }
	 $l = strlen($str) - $i;
	 $ext = substr($str,$i+1,$l);
	 return $ext;
}

$errors=0;
$image=$_FILES['image']['name'];
if ($image) 
{
	$filename = stripslashes($_FILES['image']['name']);
	$extension = getExtension($filename);
	$extension = strtolower($extension);
	if (($extension != "jpg") &#038;&#038; ($extension != "jpeg") &#038;&#038; ($extension != "png") 
		&#038;&#038; ($extension != "gif")&#038;&#038; ($extension != "JPG") &#038;&#038; ($extension != "JPEG") 
		&#038;&#038; ($extension != "PNG") &#038;&#038; ($extension != "GIF")) 
	{
		echo '<h3>Unknown extension!</h3>';
		$errors=1;
	}
	else
	{
		$size=filesize($_FILES['image']['tmp_name']);

		if ($size > MAX_SIZE*1024)
		{
			echo '<h4>You have exceeded the size limit!</h4>';
			$errors=1;
		}

		$image_name=time().'.'.$extension;
		$newname="images/".$image_name;
		
		$copied = copy($_FILES['image']['tmp_name'], $newname);
		if (!$copied) 
		{
			echo '<h3>Copy unsuccessfull!</h3>';
			$errors=1;
		}
		else echo '<h3>uploaded successfull!</h3>';
		
		mysql_query("insert into file_tbl (path) values('".$newname."')");
	}
	
	//Display image
	$rs=mysql_query("select * from file_tbl");
	if($rs)
		while($row=mysql_fetch_array($rs))
		{
		 ?>
		 <img decoding="async" width="150" src="<?php echo $row['path'];?>"><br>
		 <?php 
		}
}
?>
</pre>
<p>By using the global PHP $_FILES array you can upload files from a client computer to the remote server.</p>
<p>The first parameter is the form&#8217;s input name and the second index can be either &#8220;name&#8221;, &#8220;type&#8221;, &#8220;size&#8221;, &#8220;tmp_name&#8221; or &#8220;error&#8221;. Like this:</p>
<ul>
<li> $_FILES[&#8220;image&#8221;][&#8220;name&#8221;] &#8211; the name of the uploaded file</li>
<li>    $_FILES[&#8220;image&#8221;][&#8220;type&#8221;] &#8211; the type of the uploaded file</li>
<li>    $_FILES[&#8220;image&#8221;][&#8220;size&#8221;] &#8211; the size in bytes of the uploaded file</li>
<li>   $_FILES[&#8220;image&#8221;][&#8220;tmp_name&#8221;] &#8211; the name of the temporary copy of the file stored on the server</li>
<li>   $_FILES[&#8220;image&#8221;][&#8220;error&#8221;] &#8211; the error code resulting from the file upload</li>
</ul>
<p>This is a very simple way of uploading files. For security reasons, you should add restrictions on what the user is allowed to upload. </p><p>The post <a href="https://studentprojects.in/software-development/php-mysql/php-mysql-tutorials/upload-image-database-phpmysql/">How to upload image to database using PHP/MySQL</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/php-mysql/php-mysql-tutorials/upload-image-database-phpmysql/feed/</wfw:commentRss>
			<slash:comments>28</slash:comments>
		
		
			</item>
		<item>
		<title>How to convert Digits or numbers to word using PHP?</title>
		<link>https://studentprojects.in/software-development/php-mysql/php-tutorial/convert-digits-word-php/</link>
					<comments>https://studentprojects.in/software-development/php-mysql/php-tutorial/convert-digits-word-php/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Thu, 01 Sep 2011 04:59:59 +0000</pubDate>
				<category><![CDATA[PHP Tutorial]]></category>
		<category><![CDATA[convert to text]]></category>
		<category><![CDATA[php script]]></category>
		<category><![CDATA[digit word]]></category>
		<category><![CDATA[number to text]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1788</guid>

					<description><![CDATA[<p>Here is the code to convert digits to word using PHP Example: 564 : five hundred sixty four</p>
<p>The post <a href="https://studentprojects.in/software-development/php-mysql/php-tutorial/convert-digits-word-php/">How to convert Digits or numbers to word using PHP?</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Here is the code to convert digits to word using PHP</p>
<p><strong>Example:</strong></p>
<p>564 :  five hundred sixty four</p>
<pre lang="php" escaped="true" line="1">
<?php
$ones = array(
 "",
 " one",
 " two",
 " three",
 " four",
 " five",
 " six",
 " seven",
 " eight",
 " nine",
 " ten",
 " eleven",
 " twelve",
 " thirteen",
 " fourteen",
 " fifteen",
 " sixteen",
 " seventeen",
 " eighteen",
 " nineteen"
);

$tens = array(
 "",
 "",
 " twenty",
 " thirty",
 " forty",
 " fifty",
 " sixty",
 " seventy",
 " eighty",
 " ninety"
);

$triplets = array(
 "",
 " thousand",
 " million",
 " billion",
 " trillion",
 " quadrillion",
 " quintillion",
 " sextillion",
 " septillion",
 " octillion",
 " nonillion"
);

 // recursive fn, converts three digits per pass
function convertTri($num, $tri) {
  global $ones, $tens, $triplets;

  // chunk the number, ...rxyy
  $r = (int) ($num / 1000);
  $x = ($num / 100) % 10;
  $y = $num % 100;

  // init the output string
  $str = "";

  // do hundreds
  if ($x > 0)
   $str = $ones[$x] . " hundred";

  // do ones and tens
  if ($y < 20)
   $str .= $ones[$y];
  else
   $str .= $tens[(int) ($y / 10)] . $ones[$y % 10];

  // add triplet modifier only if there
  // is some output to be modified...
  if ($str != "")
   $str .= $triplets[$tri];

  // continue recursing?
  if ($r > 0)
   return convertTri($r, $tri+1).$str;
  else
   return $str;
 }

// returns the number as an anglicized string
function convertNum($num) {
 $num = (int) $num;    // make sure it's an integer

 if ($num < 0)
  return "negative".convertTri(-$num, 0);

 if ($num == 0)
  return "zero";

 return convertTri($num, 0);
}

 // Returns an integer in -10^9 .. 10^9
 // with log distribution
 function makeLogRand() {
  $sign = mt_rand(0,1)*2 - 1;
  $val = randThousand() * 1000000
   + randThousand() * 1000
   + randThousand();
  $scale = mt_rand(-9,0);

  return $sign * (int) ($val * pow(10.0, $scale));
 }

// example of usage
echo "564 : ".convertNum(564)."<br>";
echo "892 : ".convertNum(892);
?>
</pre>
<p>Output:</p>
<pre lang="html" escaped="true" line="1">
564 : five hundred sixty four
892 : eight hundred ninety two 
</pre><p>The post <a href="https://studentprojects.in/software-development/php-mysql/php-tutorial/convert-digits-word-php/">How to convert Digits or numbers to word using PHP?</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/php-mysql/php-tutorial/convert-digits-word-php/feed/</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
			</item>
		<item>
		<title>How to get image source from file using PHP</title>
		<link>https://studentprojects.in/software-development/php-mysql/php-tutorial/image-source-file-php/</link>
					<comments>https://studentprojects.in/software-development/php-mysql/php-tutorial/image-source-file-php/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Wed, 31 Aug 2011 17:46:31 +0000</pubDate>
				<category><![CDATA[PHP Tutorial]]></category>
		<category><![CDATA[get image source]]></category>
		<category><![CDATA[php script]]></category>
		<category><![CDATA[get img src]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1782</guid>

					<description><![CDATA[<p>Use preg_match_all to get the image source from your file. PHP code: In the above code variable $content will have the complete source code. Searching the first image using preg_match_all Output: http:studentprojects.in/favicon.ico</p>
<p>The post <a href="https://studentprojects.in/software-development/php-mysql/php-tutorial/image-source-file-php/">How to get image source from file using PHP</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Use preg_match_all to get the image source from your file.</p>
<p><strong>PHP code:</strong></p>
<pre lang="php" escaped="true" line="1">
<?php 
	$content='Lorem Ipsum is simply dummy text of the printing and typesetting industry. 
        Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, 
        when an unknown printer took a galley of type and scrambled it to make a type specimen book.
        <a href="/"><img decoding="async" alt="" id="logo" src="http:studentprojects.in/favicon.ico"></a>';
        $frst_image = preg_match_all( '|<img.*?src=[\'"](.*?)[\'"].*?>|i', $content, $matches );
	echo $item['image'] = $matches[ 1 ][ 0 ];
?>
</pre>
<p>In the above code variable $content will have the complete source code. Searching the first image using preg_match_all </p>
<p><strong>Output:</strong></p>
<pre lang="html" escaped="true" line="1">
http:studentprojects.in/favicon.ico
</pre><p>The post <a href="https://studentprojects.in/software-development/php-mysql/php-tutorial/image-source-file-php/">How to get image source from file using PHP</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/php-mysql/php-tutorial/image-source-file-php/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>How to send enquiry or feedback mail using PHP script</title>
		<link>https://studentprojects.in/software-development/php-mysql/php-tutorial/send-enquiry-feedback-mail-php-script/</link>
					<comments>https://studentprojects.in/software-development/php-mysql/php-tutorial/send-enquiry-feedback-mail-php-script/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Wed, 31 Aug 2011 16:45:33 +0000</pubDate>
				<category><![CDATA[PHP Tutorial]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[enquiry script]]></category>
		<category><![CDATA[html validation]]></category>
		<category><![CDATA[mail script]]></category>
		<category><![CDATA[JavaScript validation]]></category>
		<category><![CDATA[php feedback code]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1765</guid>

					<description><![CDATA[<p>The PHP mail() function is used to send emails from inside a script. Syntax: mail(to,subject,message,headers,parameters) Here is an example of PHP feedback-form which you can directly publish on your website. The example below sends a message to a specified e-mail address. This PHP form includes Name, Email ID, Phone No, Subject, Message. Here JavaScript validation</p>
<p>The post <a href="https://studentprojects.in/software-development/php-mysql/php-tutorial/send-enquiry-feedback-mail-php-script/">How to send enquiry or feedback mail using PHP script</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>The PHP mail() function is used to send emails from inside a script.</p>
<p><strong>Syntax:</strong><br />
mail(to,subject,message,headers,parameters)</p>
<p>Here is an example of PHP feedback-form which you can directly publish on your website. The example below sends a message to a specified e-mail address. This PHP form includes Name, Email ID, Phone No, Subject, Message. Here JavaScript validation is used for Name and email id. </p>
<p><strong>HTML form:</strong></p>
<p><figure id="attachment_1766" aria-describedby="caption-attachment-1766" style="width: 397px" class="wp-caption aligncenter"><img decoding="async" loading="lazy" class="size-full wp-image-1766" title="Enquiry mail template with validation" src="https://studentprojects.in/wp-content/uploads/2011/08/Sendmail.png" alt="Enquiry mail template with validation" width="397" height="241" /><figcaption id="caption-attachment-1766" class="wp-caption-text">Enquiry mail template with validation</figcaption></figure></p>
<p><strong>HTML form code:</strong></p>
<p>This html code also includes JavaScript validation. Save this code as feedback.html</p>
<pre lang="html" escaped="true" line="1">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Send enquiry - Electrofriends.com</title>
<script language="javascript">
function checkField(f1, tbl1, tbl2)
{
	if((f1.name.value=="") )
	{
	  document.getElementById(tbl1).style.display = '';
          return false;
	 }
	else if((f1.email.value=="") )
        {
	  document.getElementById(tbl2).style.display = '';
           return false;
        }		
	else return true;
}
</script>
</head>

<body>
<form name="f1" method="post" action="sendemail.php">
<table width="522" border="0" align="center" cellpadding="0" cellspacing="0" style="font-family:Arial, Helvetica, sans-serif; font-size:10pt;">
  <tr>
    <td width="16" height="25">&nbsp;</td>
    <td width="96">Name *</td>
    <td width="10" height="25"><strong>:</strong></td>
    <td width="163" height="25"><input name="name" type="text" id="name" /></td>
    <td width="237" height="25">
   
    <table width="233" border="0" cellspacing="0" cellpadding="0" id="tbl1" style="display:none; color:#FF0000">
  <tr>
    <td>Enter the Name</td>
  </tr>
</table>

    
    </td>
  </tr>
  <tr>
    <td height="25">&nbsp;</td>
    <td height="25">Email Id *</td>
    <td height="25"><strong>:</strong></td>
    <td height="25"><input name="email" type="text" id="email" /></td>
    <td height="25">
    
    <table width="233" border="0" cellspacing="0" cellpadding="0" id="tbl2" style="display:none; color:#FF0000">
  <tr>
    <td>Enter the Email Id</td>
  </tr>
</table>
    
    </td>
  </tr>
  <tr>
    <td height="25">&nbsp;</td>
    <td height="25">Phone No</td>
    <td height="25"><strong>:</strong></td>
    <td height="25"><input name="phone" type="text" id="phone" /></td>
    <td height="25">&nbsp;</td>
  </tr>
  <tr>
    <td height="25">&nbsp;</td>
    <td height="25">Subject</td>
    <td height="25"><strong>:</strong></td>
    <td height="25"><input name="sub" type="text" id="sub" /></td>
    <td height="25">&nbsp;</td>
  </tr>
  <tr>
    <td height="95">&nbsp;</td>
    <td height="95">Message</td>
    <td height="95"><strong>:</strong></td>
    <td height="95" colspan="2"><textarea name="message" cols="30" rows="5" id="message">&nbsp;</textarea></td>
  </tr>
  <tr>
    <td height="25" colspan="2">&nbsp;</td>
    <td height="25">&nbsp;</td>
    <td height="25" colspan="2"><input name="" type="submit" value="Submit" onclick="return checkField(f1,'tbl1','tbl2');" /> &nbsp;
    <input name="input4" type="reset" value="Reset" /></td>
  </tr>
</table>
</form>
</body>
</html>
</pre>
<p><strong>PHP code:</strong></p>
<p>Save below code as sendemail.php and update your email id.</p>
<pre lang="php" escaped="true" line="1">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Send Mail | studentprojects.in</title>
</head>

<body>
<?php  
    
    $name = $_REQUEST["name"];
    $email= $_REQUEST["email"];
    $phone = $_REQUEST["phone"];
    $sub= $_REQUEST["sub"];
    $message = $_REQUEST["message"];

    $todayis = date("l, F j, Y, g:i a") ; 
    $subject = "Enquiry From Website " ;
    $to= "xyz@yourdomain.com";

$msg.= "<table width='500' border='0' align='center' cellpadding='0' cellspacing='0' style='font-family:Arial, Helvetica, sans-serif; font-size:10pt; border:1px solid #ccc;'> ";
$msg.= "<tr>";
$msg.= "<td width='16' height='25'>&nbsp;</td>";
$msg.= "<td width='96'>Name</td>";
$msg.= "<td width='10' height='25'><strong>:</strong></td>";
$msg.= "<td height='25'>$name</td>";
$msg.= "</tr>";
$msg.= "<tr>";
$msg.= "<td height='25' bgcolor='#F5F5F5'>&nbsp;</td>";
$msg.= "<td height='25' bgcolor='#F5F5F5'>Email Id </td>";
$msg.= "<td height='25' bgcolor='#F5F5F5'><strong>:</strong></td>";
$msg.= "<td height='25' bgcolor='#F5F5F5'>$email</td>";
$msg.= "</tr>";
$msg.= "<tr>";
$msg.= "<td height='25'>&nbsp;</td>";
$msg.= "<td height='25'>Phone No</td>";
$msg.= "<td height='25'><strong>:</strong></td>";
$msg.= "<td height='25'>$phone</td>";
$msg.= "</tr>";
$msg.= "<tr>";
$msg.= "<td height='25' bgcolor='#F5F5F5'>&nbsp;</td>";
$msg.= "<td height='25' bgcolor='#F5F5F5'>Subject</td>";
$msg.= "<td height='25' bgcolor='#F5F5F5'><strong>:</strong></td>";
$msg.= "<td height='25' bgcolor='#F5F5F5'>$sub</td>";
$msg.= "</tr>";
$msg.= "<tr>";
$msg.= "<td height='95'>&nbsp;</td>";
$msg.= "<td height='95'>Message</td>";
$msg.= "<td height='95'><strong>:</strong></td>";
$msg.= "<td height='95'>$message</td>";
$msg.= "</tr>";
$msg.= "</table>";
               
$headers = "From: $name < $email >."; 
$headers .= "\r\nContent-Type: text/html; charset=ISO-8859-1\r\n"; 

mail($to, $subject, $msg, $headers) ;
	 
echo "<center><div align='center'>";
echo "<h1 style='font-family:arial, verdana; font-size:15pt;'>Your enquiry has been sent successfully!</h1>";
echo "  <br /> ";
?>
</body>
</html>

</pre>
<p><a href="https://studentprojects.in/wp-content/uploads/2011/08/Enquiry_form.zip">Download the equiry form here. </a></p><p>The post <a href="https://studentprojects.in/software-development/php-mysql/php-tutorial/send-enquiry-feedback-mail-php-script/">How to send enquiry or feedback mail using PHP script</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/php-mysql/php-tutorial/send-enquiry-feedback-mail-php-script/feed/</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
			</item>
		<item>
		<title>What is PHP?</title>
		<link>https://studentprojects.in/software-development/php-mysql/php-tutorial/php-introduction/</link>
					<comments>https://studentprojects.in/software-development/php-mysql/php-tutorial/php-introduction/#respond</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Thu, 04 Jun 2009 13:01:17 +0000</pubDate>
				<category><![CDATA[PHP Tutorial]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=551</guid>

					<description><![CDATA[<p>PHP stands for &#8220;Hypertext Preprocessor&#8220;,  is a server-side scripting language used to create dynamic Web pages. This can be embedded to HTML pages. This is very easy scripting language compare to other scripting languags. The goal of the language is to allow Web developers to write dynamically generated pages quickly. PHP supports many databases like</p>
<p>The post <a href="https://studentprojects.in/software-development/php-mysql/php-tutorial/php-introduction/">What is PHP?</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>PHP stands for &#8220;<strong>Hypertext Preprocessor</strong>&#8220;,  is a server-side scripting language used to create dynamic Web pages. This can be embedded to HTML pages. This is very easy scripting language compare to other scripting languags. The goal of the language is to allow Web developers to write dynamically generated pages quickly.</p>
<p>PHP supports many databases like MySQL, Informix, Oracle, Sybase, Solid, PostgreSQL, Generic ODBC, etc.</p>
<p>You no need any software to write this php codes. Yo can write in a basic windows notepad.</p>
<p><strong>My first PHP program:</strong></p>
<pre lang="php" escaped="true" line="1">&lt;html&gt;
&lt;body&gt;
&lt;?php
echo "MY First PHP Program";
?&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>PHP block should written inside <strong>&lt;?php</strong> and <strong>?&gt;</strong> Here echo &#8220;MY First PHP Program&#8221;; will display &#8220;MY First PHP Program&#8221; in browser.</p>
<p>Now the time to run this program. Before that you need to install server in your localhost. Learn how in next pages.</p><p>The post <a href="https://studentprojects.in/software-development/php-mysql/php-tutorial/php-introduction/">What is PHP?</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/php-mysql/php-tutorial/php-introduction/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
