I cannot upload more than 1mb photo into databases.
i`m using wampserver.when it is below one 1mb it is uploaded. your help will be appreciated.
Down is the code i used to upload photo.
upload.php
<form action="addphoto.php" method="POST" enctype="multipart/form-data">
<table cellpadding=0 cellsapcing=0 border=0 align=center width=450 height=50 bgcolor=gray>
<tr><td><p><b><font color=blue>UPLOAD YOUR PROFILE PHOTO</font></b></p>
<p><input type="hidden" name="MAX_FILE_SIZE" value="102400"></br><input type="hidden" name="user" value="<?php echo $user;?>"></br>
<input type="hidden" name="userid" value="<?php echo $id;?>">
Image :<input type="file" name="file"><br/>
<center><input type="submit" value="Upload" name="submit"></center></p></td></tr>
</table>
</form>
addphoto.php
<?php
if ($_POST) {
$user=$_POST;
$id=$_POST;
if ($_POST >= $_FILES) {
//print_r($_FILES);
mysql_connect("localhost", "root", "650715") or die(mysql_error());
mysql_select_db("register");
$photo = addslashes(fread(fopen($_FILES, "r"),
$_FILES));
$query = sprintf("INSERT INTO image(image, filetype,user,userid) VALUES
('%s', '%s','$user','$id')", $photo, $_FILES);
if (mysql_query($query)) {
echo "Your files is successfully stored in database";
} else {
echo"Error detected while trying to upload your photo<br> Try again please";
}
} else {
echo"The file is bigger than the allowed size please resize";
}
}
?>