A Simple PHP Multi Uploader with rand() and time()
I think this would be the simplest file multi uploader to an specific location. It uses copy() for the upload method and add a random number based on time to avoid replacement of the files including same file name.
This is the approach:
The form for uploading:
-
<table border="0" cellspacing="1" cellpadding="0" width="500" align="center" bgcolor="#cccccc">
-
<tbody>
-
<tr>
-
<form id="form1" action="multiple_upload_ac.php" enctype="multipart/form-data" method="post">
-
<td>
-
<table border="0" cellspacing="1" cellpadding="3" width="100%" bgcolor="#ffffff">
-
<tbody>
-
<tr>
-
<td><strong>multiple Files Upload </strong></td>
-
</tr>
-
<tr>
-
<td>Select file
-
<input id="ufile[]" name="ufile[]" size="50" type="file" /></td>
-
</tr>
-
<tr>
-
<td>Select file
-
<input id="ufile[]" name="ufile[]" size="50" type="file" /></td>
-
</tr>
-
<tr>
-
<td>Select file
-
<input id="ufile[]" name="ufile[]" size="50" type="file" /></td>
-
</tr>
-
<tr>
-
<td align="center">
-
<input name="Submit" type="submit" value="Upload" /></td>
-
</tr>
-
</tbody></table>
-
</td>
-
</form></tr>
-
</tbody></table>

The processor file:
-
$path1=$path1a.time().$num1.'_'.basename($_FILES['ufile']['name'][0]);
-
-
//add a random name with the base name
-
$path2=$path2a.time().$num2.'_'.basename($_FILES['ufile']['name'][1]);
-
$path3=$path3a.time().$num3.'_'.basename($_FILES['ufile']['name'][2]);
-
-
//copy file to where you want to store file
-
copy($_FILES['ufile']['tmp_name'][0], $path1);
-
copy($_FILES['ufile']['tmp_name'][1], $path2);
-
copy($_FILES['ufile']['tmp_name'][2], $path3);
-
-
//$_FILES['ufile']['name'] = file name
-
//$_FILES['ufile']['size'] = file size
-
//$_FILES['ufile']['type'] = type of file
-
echo "File Name :".$_FILES['ufile']['name'][0]."
-
";
-
echo "File Size :".$_FILES['ufile']['size'][0]."
-
";
-
echo "File Type :".$_FILES['ufile']['type'][0]."
-
";
-
echo "<img src="\" alt="" width="150" height="150" />";
-
echo "
-
";
-
-
echo "File Name :".$_FILES['ufile']['name'][1]."
-
";
-
echo "File Size :".$_FILES['ufile']['size'][1]."
-
";
-
echo "File Type :".$_FILES['ufile']['type'][1]."
-
";
-
echo "<img src="\" alt="" width="150" height="150" />";
-
echo "
-
-
";
-
-
echo "File Name :".$_FILES['ufile']['name'][2]."
-
";
-
echo "File Size :".$_FILES['ufile']['size'][2]."
-
";
-
echo "File Type :".$_FILES['ufile']['type'][2]."
-
";
-
echo "<img src="\" alt="" width="150" height="150" />";
-
-
///////////////////////////////////////////////////////
-
-
// Use this code to display the error or success.
-
-
$filesize1=$_FILES['ufile']['size'][0];
-
$filesize2=$_FILES['ufile']['size'][1];
-
$filesize3=$_FILES['ufile']['size'][2];
-
-
if($filesize1 && $filesize2 && $filesize3 != 0)
-
{
-
echo "We have recieved your files";
-
}
-
-
else {
-
echo "ERROR…..";
-
}
-
-
//////////////////////////////////////////////
-
-
// What files that have a problem? (if found)
-
-
if($filesize1==0) {
-
echo "There're something error in your first file";
-
echo "
-
";
-
}
-
-
if($filesize2==0) {
-
echo "There're something error in your second file";
-
echo "
-
";
-
}
-
-
if($filesize3==0) {
-
echo "There're something error in your third file";
-
echo "
-
";
-
}
-
-
?>
Download the code from left flush widget “upload.zip”
Authentication Module with E-mail & Image Verification!
I’ve built an authentication system which can be used as secured module in a registration form or in a suggestion box where there are probability of insertion of data by a robot script. By using the image verification fact no auto generated script can fill up a form. Other wise there is an e-mail verification fact by which the man who fill up the form giving his e-mail address should check up his inbox for the mail sent by the form.
The e-mail is sent with a link on which by clicking it executes a script for neccessary update in the database.

In this module when a user fill up the form then in database every data is inserted and in a filled named active ’0′ is inserted. When the user clicks on the link sent to him by e-mail. It then executes another script page which then updates the value of active field into ’1′.
Then you can verify a user by examining the value of his active field in database that ensures that he clicked on th link.
This can be used as module in any Webapp.
See the example: Register Login
You can download the source code from the ShareBox left of side of my site. named Auth.zip
My 5th Semester Project!
I have launched my 5th semester project on the web for testing and further feedback. I was directed to make a web app for a garments shop. There are two types of use. Administrator can upload a product by specific privilege and customer can see required product or all product by searching with requirements. They also can by the product.
The address: My project
Another Power of Ajax! Instant Edit on View-Page
When a page is displayed with requested data from a database, then normally the data it contains can be edited or updated by getting the id of that form and by using that to update the form. Now, with the Ajax you can make a output page where you can edit the field of the form by just clicking on it and it will be saved to database instantly.
I’m unable to describe the benifit or beauty of this task. Just try it and make it more effective and do the JavaScript and be with Ajax. Example named insedit.zip
Feelings of Drag and Drop using Ajax-PHP-MySQL
Refference -Building Responsive Web Application by PACKT PUBLICATION
You Just try this example and feel the power of Ajax and the libraries just like Script.aculo.us , prototype.js . Recently, Web Application without attractive interface is not accepted to real users. So, use the maximum of Libraries and Frameworks.
You can get this example in my Shared Box named dragdrop.zip






