amir4oracle
Programmer
How can we find width and height of an image file being uploaded, I am using the following code:
Do we have to use JS etc or PHP itself what can we do to find out the width and height of the images users are uploading.
Your help is highly appreciated.
Thanks in advance.
Code:
<?php
require_once ('conn_db.php');
if (isset ($_POST['submit']))
{
for ($i=0; $i <= 3; $i++)
if ($_FILES['photo']['name'][$i] != '')
if(move_uploaded_file($_FILES['photo']['tmp_name'][$i], "images/" . basename($_FILES['photo']['name'][$i])))
$pic[$i] = ($_FILES['photo']['name'][$i]);
for ($i=0; $i <= 3; $i++)
if ($pic[$i] != '')
@mysql_query ("INSERT INTO images VALUES ('$i', '$pic[$i]')");
}
?>
<form enctype="multipart/form-data" action=<?php echo "picstest.php"?> method="POST">
<input type="file" name = "photo[]"> <br />
<input type="file" name = "photo[]"> <br />
<input type="file" name = "photo[]"> <br />
<input type="file" name = "photo[]"> <br />
<input type="submit" value=" Submit " name="submit">
</form>
Your help is highly appreciated.
Thanks in advance.