Jump to content

[SOLVED] Upload images error


sungpeng

Recommended Posts

<?php

include 'config2.php';
if($_POST[action]=="Update")
{	

$check_result=0;
$check_login=mysql_query("select * from users where email='$_POST[user]' and passwd='$_POST[pass]' and pid='$_GET[pid]'");
$check_result=mysql_num_rows($check_login);		


}

if($check_result>0)
{

$indexnumber=$_GET[pid];
$folder_path="photo/$indexnumber/";


if (file_exists("photo/$indexnumber"))
{
}
else
{
mkdir($folder_path,0777);
}

echo $indexnumber;


		$file_upload_err=0;
		$max_file_size="10000000"; 
		$max_file_size_kb="500";
		$file_upload_err_msg="";

		if($_FILES['imagefile']['size']>$max_file_size)
		{
		echo "image file too big";	
            

            }elseif
($imagefile && ($_FILES['imagefile']['type']!="image/jpeg" && $_FILES['imagefile']['type']!="image/pjpeg"))
		{
			$type=$_FILES['imagefile']['type'];
				echo "image file type wrong";
                
		}





}else{ ?>






<html>

<title>Upload an image to a database</title>


<body>




<h2>Update with new information</h2>

<form name="form" enctype="multipart/form-data" method="post" action="<?php echo"$PHP_SELF?pid=$_GET[pid]"; ?>">
Please insert the images
<input type='file' name='imagefile'><br>


<br>
USER : <input name="user"><br>
PASSWORD : <input name="pass"><br>


<input type="submit" name="action" value="Update">
</form>

</body>
</html>

<?php
} ?>

 

Hi I keep editing the above code but it seem not working. Can anyone help? Parse error: syntax error?

 

Link to comment
https://forums.phpfreaks.com/topic/152195-solved-upload-images-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.