one.html
<form method="post" enctype="multipart/form-data" action="two.php">
<input type="hidden" name="PHPSESSID" value=<?php echo $PHPSESSID;?>>
<br><input type="file" name="fileimage">
<br><input type="submit" value="Upload"></form>
two.php
//check file type to be an image
$imgsz = getimagesize($fileimage);
if(!$imgsz[2]) {
echo "ERROR: Only image files are accepted; JPG and GIF are suggested";
exit;
}
//check file size. $MAX_IMAGE_SIZE is in bytes; set in config.php
if(filesize($fileimage) > $MAX_IMAGE_SIZE) {
echo "ERROR: Files must be smaller than $MAX_IMAGE_SIZE";
exit;
}
$ques = "../uploads/";
if ($aux=@opendir($ques))
{
closedir($aux);
}
else {
mkdir($ques, 0775);
}
copy($fileimage_name,"../uploads/$fileimage_name");
I stripped this out of some code I use. It should get you started. Files will be stored on the server. You can also store the file in the database using BLOB (Binary Large OBject) datatypes. I don't have any code for that and don't recommend it unless you've got a real good reason to store files in a database. By the way, I used to live in Round Rock (and Austin too).