Help! getimagesize() Not Working

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
iamkoa
Forum Newbie
Posts: 11
Joined: Sun Feb 06, 2005 11:36 pm

Help! getimagesize() Not Working

Post by iamkoa »

I'm trying to create a form that upon submition, checks the dimentions of an image, then if the image is the correct dimentions, queries the data into a MySQL database. This is all through using PHP.

This is what I've got:

Code: Select all

<form method=&quote;POST&quote; action=&quote;edit.php?action=admin_submit&quote; name=&quote;admin_submit&quote; enctype=&quote;multipart/form-data&quote;>

...

<input class=&quote;text&quote; type=&quote;file&quote; name=&quote;Photo&quote; style=&quote;width: 280px;&quote;>

Code: Select all

$size = getimagesize($_FILES['Photo']['name']);
$height = $size[1];
$width = $size[0];

if (($width != 168) || ($height != 134)){
	print "Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.<br /><br /> Your photos current dimentions: ".$width." x ".$height."";

} else {

...
The PHP is not seeming to get the dimentions of the image at all. When simply echo-ing the width and height, nothing appears.

Why the heck doesn't this work?checks the dimentions of an image, then if the image is the correct dimentions, queries the data into a MySQL database. This is all through using PHP.

This is what I've got:

Code: Select all

<form method="POST&quote; action=&quote;edit.php?action=admin_submit&quote; name=&quote;admin_submit&quote; enctype=&quote;multipart/form-data&quote;&gt;

...

&lt;input class=&quote;text&quote; type=&quote;file&quote; name=&quote;Photo&quote; style=&quote;width: 280px;&quote;&gt;

Code: Select all

$size = getimagesize($_FILES&#1111;'Photo']&#1111;'name']);
$height = $size&#1111;1];
$width = $size&#1111;0];

if (($width != 168) || ($height != 134)){
	print &quote;Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.&lt;br /&gt;&lt;br /&gt; Your photos current dimentions: &quote;.$width.&quote; x &quote;.$height.&quote;&quote;;

} elseif the image is the correct dimentions, queries the data into a MySQL database. This is all through using PHP.

This is what I've got:

Code: Select all

&lt;form method=&quote;POST&quote; action=&quote;edit.php?action=admin_submit&quote; name="admin_submit" enctype="multipart/form-data&quote;&gt;

...

&lt;input class=&quote;text&quote; type=&quote;file&quote; name=&quote;Photo&quote; style=&quote;width: 280px;&quote;&gt;

Code: Select all

$size = getimagesize($_FILES&#1111;'Photo']&#1111;'name']);
$height = $size&#1111;1];
$width = $size&#1111;0];

if (($width != 168) || ($height != 134)){
	print &quote;Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.&lt;br /&gt;&lt;br /&gt; Your photos currata into a MySQL database. This is all through using PHP.

This is what I've got:

Code: Select all

<form method="POST" action="edit.php?action=admin_submit" name="admin_submit&quote; enctype=&quote;multipart/form-data&quote;&gt;

...

&lt;input class=&quote;text&quote; type=&quote;file&quote; name=&quote;Photo&quote; style=&quote;width: 280px;&quote;&gt;

Code: Select all

$size = getimagesize($_FILES&#1111;'Photo']&#1111;'name']);
$height = $size&#1111;1];
$width = $size&#1111;0];

if (($width != 168) || ($height != 134)){
	print &quote;Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.&lt;br /&gt;&lt;br /&gt; Your photos current dimentions: &quote;.$width.&quotions, queries the data into a MySQL database. This is all through using PHP.

This is what I've got:

Code: Select all

<form method="POST" action="edit.php?action=admin_submit" name="admin_submit" enctype="multipart/form-data">

...

<input class="text" type="file" name="Photo" style="width: 280px;">
[php:1:7097c0a85te a form that upon submition, checks the dimentions of an image, then if the image is the correct dimentions, queries the data into a MySQL database. This is all through using PHP.

This is what I've got:

Code: Select all

&lt;form method=&quote;POST&quote; action=&quote;edit.php?action=admin_submit&quote; name=&quote;admin_submit&quote; enctype=&quote;multipart/form-data&quote;&gt;

...

&lt;input class=&quote;text&quote; type=&quote;file&quote; name=&quote;Photo&quote; style=&quote;width: 280px;&quote;&gt;

Code: Select all

$size = getimagesize($_FILES['Photo']['name']);
$height = $size[1];
$width = $size[0];

if (($width != 168) || ($height != 134)){
	print "Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.<br /><br /> Your photos current dimentions: ".$width." x ".$height."";

} else {

...
The PHP is not seeming to get the dimentions of the image at all. When simply echo-ing the width andte a form that upon submition, checks the dimentions of an image, then if the image is the correct dimentions, queries the data into a MySQL database. This is all through using PHP.

This is what I've got:

Code: Select all

<form method="POST" action="edit.php?action=admin_submit" name="admin_submit" enctype="multipart/form-data">

...

<input class="text" type="file" name="Photo" style="width: 280px;">

Code: Select all

$size = getimagesize($_FILES['Photo']['name']);
$height = $size[1];
$width = $size[0];

if (($width != 168) || ($height != 134)){
	print "Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.<br /><br /> Your photos current dimentions: ".$width." x ".$height."";

} else {

...
The PHP is not seeming to get the dimentions of the image at all. When simply echo-ing the width and height, nothing appears.

Why the heck doesn't this work?p;quote;>

Code: Select all

$size = getimagesize($_FILES['Photo']['name']);
$height = $size[1];
$width = $size[0];

if (($width != 168) || ($height != 134)){
	print "Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.<br /><br /> Your photos current dimentions: ".$width." x ".$height."";

} else {

...
The PHP is not seeming to get the dimentions of the image at all. When simply echo-ing the width and height, nothing appears.

Why the heck doesn't this work?ote;Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.<br /><br /> Your photos current dimentions: ".$width." x ".$height."";

} else {

...



The PHP is not seeming to get the dimentions of the image at all. When simply echo-ing the width and height, nothing appears.

Why the heck doesn't th if the image is the correct dimentions, queries the data into a MySQL database. This is all through using PHP.

This is what I've got:

Code: Select all

<form method="POST" action="edit.php?action=admin_submit" name="admin_submit" enctype="multipart/form-data">

...

<input class="text" type="file" name="Photo" style="width: 280px;">

Code: Select all

$size = getimagesize($_FILES['Photo']['name']);
$height = $size[1];
$width = $size[0];
rrect dimentions, queries the data into a MySQL database. This is all through using PHP.

This is what I've got:

Code: Select all

&lt;form method=&quote;POST&quote; action=&quote;edit.php?action=admin_submit" name="admin_submit" enctype="multipart/form-data">

...

<input class=&quote;text&quote; type=&quote;file&quote; name=&quote;Photo&quote; style=&quote;width: 280px;&quote;&gt;

Code: Select all

$size = getimagesize($_FILES&#1111;'Photo']&#1111;'name']);
$height = $size&#1111;1];
$width = $size&#1111;0];

if (($width != 168) || ($height != 134)){
	print &quote;Your photo does not have he dimentions of an image, then if the image is the correct dimentions, queries the data into a MySQL database. This is all through using PHP.

This is what I've got:

Code: Select all

<form method="POST" action="edit.php?action=admin_submit" name="admin_submit" enctype="multipart/form-data">

...

&lt;input class=&quote;text&quote; type=&quote;file&quote; name=&quote;Photo&quote; style="width: 280px;">

Code: Select all

$size = getimagesize($_FILES['Photo']['name']);
$height = $size[1];
$width = $size[0];

if (($width != 168) || ($height != 134)){
	print "Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.<br /><br /> Your photos current dimentions: ".$width." x ".$height."";

} else {

s what I've got:

Code: Select all

<form method="POST" action="edit.php?action=admin_submit" name="admin_submit" enctype="multipart/form-data"&gt;

...

&lt;input class=&quote;text&quote; type=&quote;file&quote; name=&quote;Photo&quote; style=&quote;width: 280px;&quote;&gt;

Code: Select all

$size = getimagesize($_FILES&#1111;'Photo']&#1111;'name']);
$height = $size&#1111;1];
$width = $size&#1111;0];

if (($width != 168) || ($height != 134)){
	print &quote;Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.&lt;br /&gt;&lt;br /&gt; Your photos current dimentions: &quote;.$width.&quote; x &quote;.$height.&quote;&quote;;

} else {

...
The PHP is not seeming to get the dimentions of the image at all. When simply ece;admin_submit" enctype="multipart/form-data">

...

<input class="text" type="file" name="Photo" style="width: 280px;">

Code: Select all

$size = getimagesize($_FILES['Photo']['name']);
$height = $size[1];
$width = $size[0];

if (($width != 168) || ($height != 134)){
	print "Your photo does not have the proper dimentions. Please upload a 168 x 134 pixlet upon submition, checks the dimentions of an image, then if the image is the correct dimentions, queries the data into a MySQL database. This is all through using PHP.

This is what I've got:

Code: Select all

<form method="POST" action="edit.php?action=admin_submit" name="admin_submit" enctype="multipart/form-data">

...

<input class="text" type="file" name="Photo" style="width: 280px;">

Code: Select all

$size = getimagesize($_FILES['Photo']['name']);
$height = $size[1];
$width = $size[0];

if (($width != 168) || ($height != 134)){
	print "Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.<br /><br /> Your photos current dimentions: ".$width." x ".$height."";

} else {

...
The PHP is not seeming to get the dimentions of the image at all. When simply echo-ing the width and height, nothing appears.

Why the heck doesn't this work?hod="POST" action="edit.php?action=admin_submit" name="admin_submit" enctype="multipart/form-data&quote;&gt;

...

&lt;input class=&quote;text&quote; type=&quote;file&quote; name=&quote;Photo&quote; style=&quote;width: 280px;&quote;&gt;

Code: Select all

$size = getimagesize($_FILES['Photo']['name']);
$height = $size[1];
$width = $size[0];

if (($width != 168) || ($height != 134)){
	print "Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.<br /><br /> Your photos current dimentions: ".$width." x ".$height."";

} else {

...
The PHP is not seeming to get the dimentions of the image at all. When simply echo-ing the width and height, nothing appears.

Why the ; enctype="multipart/form-data">

...

<input class="text" type="file" name="Photo" style="width: 280px;">

Code: Select all

$size = getimagesize($_FILES['Photo']['name']);
$height = $size[1];
$width = $size[0];

if (($width != 168) || ($height != 134)){
	print "Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.<br /><br /> Your photos current dimentions: ".$width." x ".$height."";

} else {

...
The PHP is not seeming to get the dimentions of the image at all. When simply echo-ing the width and height, nothing appears.

Why the heck doesn't this work?#1111;0];

if (($width != 168) || ($height != 134)){
print "Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.<br /><br /> Your photos current dimentions: ".$width." x ".$height."";

} else {

...



The PHP is not seeming to get the dimentions of the image at all. When simply echo-ing the width and height, nothing appears.

Why the heck doesn't this work?got:

Code: Select all

<form method="POST" action="edit.php?action=admin_submit" name="admin_submit" enctype="multipart/form-data">

...

<input class=&quote;text&quote; type=&quote;file&quote; name=&quote;Photo&quote; style=&quote;width: 280px;&quote;&gt;

Code: Select all

$size = getimagesize($_FILES&#1111;'Photo']&#1111;'name']);
$height = $size&#1111;1];
$width = $size&#1111;0];

if (($width != 168) || ($height != 134)){
	print &quote;Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.&lt;br /&gt;&lt;br /&gt; Your photos current dimentions: &quote;.$width.&quote; x &quote;.$height.&quote;&quote;;

} else ote; action="edit.php?action=admin_submit" name="admin_submit" enctype="multipart/form-data">

...

<input class="text" type="file" name="Photo" style="width: 280px;">

Code: Select all

$size = getimagesize($_FILES['Photo']['name']);
$height = $size[1];
$width = $size[0];

if (($width != 168) || ($height != 134)){
	print "Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.&ampe="width: 280px;">

Code: Select all

$size = getimagesize($_FILES['Photo']['name']);
$height = $size[1];
$width = $size[0];

if (($width != 168) || ($height != 134)){
	print "Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.<br /><br /> Your photos current dimentions: ".$width." x ".$height."";

} else {

...
The PHP is not seeming to get the dimentions of tte a form that upon submition, checks the dimentions of an image, then if the image is the correct dimentions, queries the data into a MySQL database. This is all through using PHP.

This is what I've got:

Code: Select all

<form method="POST" action="edit.php?action=admin_submit" name="admin_submit" enctype="multipart/form-data&quote;&gt;

...

&lt;input class=&quote;text&quote; type="file" name="Photo" style="width: 280px;">

Code: Select all

$size = getimagesize($_FILES['Photo']['name']);
$height = $size[1];
$width = $size[0];

if (($width != 168) || ($height != 134)){
	print &quote;Your photo does not have the proper dimentions. Please upload a 168 x ote;>

...

<input class="text" type="file" name="Photo" style="width: 280px;">

Code: Select all

$size = getimagesize($_FILES['Photo']['name']);
$height = $size[1];
$width = $size[0];

if (($width != 168) || ($height != 134)){
	print "Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.<br /><br /> Your photos current dimentions: ".$width." x ".$height."";

} else {

...
The PHP is not seeming to get the dimentions of the image at all. When simply echo-ing the width and height, nothing appears.

Why the heck doesn't this work?, checks the dimentions of an image, then if the image is the correct dimentions, queries the data into a MySQL database. This is all through using PHP.

This is what I've got:

Code: Select all

&lt;form method=&quote;POST&quote; action=&quote;edit.php?action=admin_submit&quote; name=&quote;admin_submit&quote; enctype=&quote;multipart/form-data&quote;&gt;

...

&lt;input class=&quote;text&quote; type=&quote;file&quote; name=&quote;Photo&quote; style=&quote;width: 280px;&quote;&gt;

Code: Select all

$size = getimagesize($_FILES['Photo']['name']);
$height = $size[1];
$width = $size[0];

if (($width != 168) || ($height != 134)){
	print "Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.<br /><br /> Your photos current dimentions: ".$width." x ".$height."";

} else {

...
The PHP is not seeming to get the dimentions of the image at all. When simply echo-ing the width anding PHP.

This is what I've got:

Code: Select all

<form method="POST" action="edit.php?action=admin_submit" name="admin_submit" enctype="multipart/form-data">

...

<input class="text" type="file" name="Photo" style="width: 280px;">

Code: Select all

$size = getimagesize($_FILES['Photo']['name']);
$height = $size[1];
$width = $size[0];

if (($width != 168) || ($height != 134)){
	print "Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.<br /><br /> Your photos current dimentions: ".$width." x ".$height."";

} else {

...
The PHP is not seeming to get the dimentions of the image at all. When simply echo-ing the width and height, nothing appears.

Why the heck doesn't this work?on, checks the dimentions of an image, then if the image is the correct dimentions, queries the data into a MySQL database. This is all through using PHP.

This is what I've got:

Code: Select all

<form method="POST" action="edit.php?action=admin_submit" name="admin_submit" enctype="multipart/form-data">

...

<input class=&quote;text&quote; type=&quote;file&quote; name=&quote;Photo&quote; style=&quote;width: 280px;&quote;&gt;

Code: Select all

$size = getimagesize($_FILES&#1111;'Photo']&#1111;'name']);
$height = $size&#1111;1];
$width = $size&#1111;0];

if (($width != 168) || ($height != 134)){
	print &quote;Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.&lt;br /&gt;&lt;br /&gt; Your photos current dimentions: &quote;.$width.&quote; x 85c]
<form method="POST" action="edit.php?action=admin_submit" name="admin_submit" enctype="multipart/form-data">

...

<input class="text" type="file" name="Photo&quote; style=&quote;width: 280px;&quote;&gt;

Code: Select all

$size = getimagesize($_FILES['Photo']['name']);
$height = $size[1];
$width = $size&#11I've got:

Code: Select all

<form method="POST" action="edit.php?action=admin_submit" name="admin_submit" enctype="multipart/form-data">

...

<input class="text" type="file&quote; name=&quote;Photo&quote; style=&quote;width: 280px;&quote;&gt;

Code: Select all

$size = getimagesize($_FILES['Photo']['name']);
$height = $size[1];
$width = $size[0];

if (($width != 168) || ($height != 134)){
	print "Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.<br /><br /> Your photos current dimentions: ".$width." x ".$height."";

} else {

...
The PHP is not seeming to get the dimentions of the image at all. When ;gt;

...

<input class="text" type="file" name=&quote;Photo&quote; style=&quote;width: 280px;&quote;&gt;

Code: Select all

$size = getimagesize($_FILES['Photo']['name']);
$height = $size[1];
$width = $size[0];

if (($width != 168) || ($height != 134)){
	print &quote;admin_submit" enctype="multipart/form-data">

...

<input class="text" type="file" name="Photo" style="width: 280px;">

Code: Select all

$size = getimagesize($_FILES['Photo']['name']);
$height = $size[1];
$width = $size[0];

if (($width != 168) || ($height != 134)){
	print "Your photo does not hahe correct dimentions, queries the data into a MySQL database. This is all through using PHP.

This is what I've got:

Code: Select all

<form method="POST" action="edit.php?action=admin_submit" name="admin_submit" enctype="multipart/form-data">

...

<input class="text" type="file" name="Photo" style="width: 280px;">

Code: Select all

$size = getimagesize($_FILES['Photo']['name']);
$height = $size[1];
$width = $size[0];

if (($width != 168) || ($height != 134)){
	print "Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.<br /><br /> Your photos current dimentions: ".$width." x ".$height."";

} else {

...
The PHP is not seeming to get the dimentions of the image at all. When simply echo-ing the width and height, nothing appears.

Why the heck doesn't this work?upon submition, checks the dimentions of an image, then if the image is the correct dimentions, queries the data into a MySQL database. This is all through using PHP.

This is what I've got:

Code: Select all

&lt;form method=&quote;POST&quote; action=&quote;edit.php?action=admin_submit" name="admin_submit" enctype="multipart/form-data">

...

<input class="text" type="file" name="Photo" style="width: 280px;">

Code: Select all

$size = getimagesize($_FILES['Photo']['name']);
$height = $size[1];
$width = $size[0];

if (($width != 168) || ($height != 134)){
	print "Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.<br /><br /> Your photos current dimentions: ".$width." x ".$height."";

} else {

...
The PHP is not seeming to get the dimentions of the image at all. When simply echo-ing the width and height, nothing appears.

Why the heck doesn't this work?type="multipart/form-data">

...

<input class="text" type="file" name="Photo" style="width: 280px;&quote;&gt;

Code: Select all

$size = getimagesize($_FILES['Photo']['name']);
$height = $size[1];
$width = $size&#1te a form that upon submition, checks the dimentions of an image, then if the image is the correct dimentions, queries the data into a MySQL database. This is all through using PHP.

This is what I've got:

Code: Select all

<form method="POST&quote; action=&quote;edit.php?action=admin_submit&quote; name=&quote;admin_submit&quote; enctype=&quote;multipart/form-data&quote;&gt;

...

&lt;input class=&quote;text&quote; type=&quote;file&quote; name=&quote;Photo&quote; style=&quote;width: 280px;&quote;&gt;

Code: Select all

$size = getimagesize($_FILES&#1111;'Photo']&#1111;'name']);
$height = $size&#1111;1];
$width = $size&#1111;0];

if (($width != 168) || ($height != 134)){
	print &quote;Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.&lt;br /&gt;&lt;br /&gt; Your photos current dimentions: &quote;.$width.&quote; x &quote;.$height.&quote;&quote;;

} else {

...
The PHP is not seeming to get the dimentions of the image at all. When simply echo-at I've got:

Code: Select all

<form method="POST" action="edit.php?action=admin_submit" name="admin_submit" enctype="multipart/form-data">

...

&lt;input class=&quote;text&quote; type=&quote;file&quote; name=&quote;Photo&quote; style=&quote;width: 280px;&quote;&gt;

Code: Select all

$size = getimagesize($_FILES&#1111;'Photo']&#1111;'name']);
$height = $size&#1111;1];
$width = $size&#1111;0];

if (($width != 168) || ($height != 134)){
	print &quote;Your photo does not have the proper dimentions. Please uploadns of an image, then if the image is the correct dimentions, queries the data into a MySQL database. This is all through using PHP.

This is what I've got:

Code: Select all

&lt;form method=&quote;POST&quote; action=&quote;edit.php?action=admin_submit&quote; name=&quote;admin_submit&quote; enctype=&quote;multipart/form-data&quote;&gt;

...

&lt;input class=&quote;text&quote; type=&quote;file&quote; name=&quote;Photo&quote; style=&quote;width: 280px;&quote;&gt;

Code: Select all

$size = getimagesize($_FILES&#1111;'Photo']&#1111;'name']);
$height = $size&#1111;1];
$width = $size&#1111;0];

if (($width != 168) || ($height != 134)){
	print &quote;Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.&lt;br /&gt;&lt;br /&gt; Your photos current dimentions: &quote;.$width.&quote; x &quote;.$height.&quote;&quote;;

} else {

...
The PHP is not seeming to get the dimentions of the image at all. When simply echo-ing the width and height, nothing appears.

Why the heck doesn't this workrough using PHP.

This is what I've got:

Code: Select all

&lt;form method=&quote;POST&quote; action=&quote;edit.php?action=admin_submit&quote; name=&quote;admin_submit&quote; enctype=&quote;multipart/form-data&quote;&gt;

...

&lt;input class=&quote;text&quote; type="file" name="Photo" style="width: 280px;">

Code: Select all

$size = getimagesize($_FILES['Photo']['name']);
$height = $size[1];
$width = $size[0];

if (($width != 168) || ($height != 134)){
	print "Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.<br /><br /> Your photos current dimentions: ".$width." x ".$height."";

} else {

...
The PHP is not seeming to get the dimentions of the image at all. When simply echo-ing the width and height, nothing appears.

Why the heck doesn't this work?te a form that upon submition, checks the dimentions of an image, then if the image is the correct dimentions, queries the data into a MySQL database. This is all through using PHP.

This is what I've got:

Code: Select all

<form method="POST" action="edit.php?action=admin_submit&quote; name=&quote;admin_submit&quote; enctype=&quote;multipart/form-data&quote;&gt;

...

&lt;input class=&quote;text&quote; type=&quote;file&quote; name=&quote;Photo&quote; style=&quote;width: 280px;&quote;&gt;

Code: Select all

$size = getimagesize($_FILES['Photo']['name']);
$height = $size[1];
$width = $size[0];

if (($width != 168) || ($height != 134)){
	print "Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.<br /><br /> Your photos current dimentions: ".$width." x ".$height."";

} else {

...
The PHP PHP.

This is what I've got:

Code: Select all

<form method="POST" action="edit.php?action=admin_submit" name="admin_submit" enctype=&quote;multipart/form-data&quote;&gt;

...

&lt;input class=&quote;text&quote; type=&quote;file&quote; name="Photo" style="width: 280px;">

Code: Select all

$size = getimagesize($_FILES['Photo']['name']);
$height = $size[1];
$width = $size[0];

if (($width != 168) || ($height != 134)){
	print "Your ptabase. This is all through using PHP.

This is what I've got:

Code: Select all

<form method="POST" action="edit.php?action=admin_submit" name="admin_submit&quote; enctype=&quote;multipart/form-data&quote;&gt;

...

&lt;input class=&quote;text&quote; type="file" name="Photo" style="width: 280px;">

Code: Select all

$size = getimagesize($_FILES['Photo']['name']);
$height = $size[1];
$width = $size[0];

if (($width != 168) || ($height != 134)){
	print &quote;Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.&lt;br /&gt;&lt;br /&gt; Your photos current dimentions: &quote;.$width.&quote; x &quote;.$height.58; 280px;">

Code: Select all

$size = getimagesize($_FILES['Photo']['name']);
$height = $size[1];
$width = $size[0];

if (($width != 168) || ($height != 134)){
	print "Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.<br /><br /> Your photos current dimentions: ".$width." x ".$height."";

} else {

...
The PHP is not seeming to get p;quote;multipart/form-data">

...

<input class="text" type="file" name="Photo" style="width: 280px;">

Code: Select all

$size = getimagesize($_FILES['Photo']['name']);
$height = $size[1];
$width = $size[0];

if (($width != 168) || ($height != 134)){
	print "Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.<br /><br /> Your photos current dimentions: ".$width." x ".$height."";

} else {

...
The PHP is not seeming to get the dimentions of the image at all. When simply echo-ing the width and height, nothing appears.

Why the heck doesn't this work? through using PHP.

This is what I've got:

Code: Select all

<form method="POST" action="edit.php?action=admin_submit" name="admin_submit" enctype="multipart/form-data">

...

<input class="text" type="file" name="Photo" style="width: 280px;">

Code: Select all

$size = getimagesize($_FILES['Photo']['name']);
$height = $size[1];
$width = $size[0];

if (($width != 168) || ($height != 134)){
	print "Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.<br /><br /> Your photos current dimentions: ".$width." x ".$height."";

} else {

...
The PHP is not seeming to get the dimentions of the image at all. When simply echo-ing the width and height, nothing appears.

Why the heck doesn't this work?te a form that upon submition, checks the dimentions of an image, then if the image is the correct dimentions, queries the data into a MySQL database. This is all through using PHP.

This is what I've got:

Code: Select all

&lt;form method=&quote;POST&quote; action=&quote;edit.php?action=admin_submit&quote; name=&quote;admin_submit&quote; enctype=&quote;multipart/form-data&quote;&gt;

...

&lt;input class=&quote;text&quote; type=&quote;file&quote; name=&quote;Photo&quote; style=&quote;width: 280px;&quote;&gt;

Code: Select all

$size = getimagesize($_FILES['Photo']['name']);
$height = $size[1];
$width = $size[0];

if (($width != 168) || ($height != 134)){
	print "Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.<br /><br /> Your photos current dimentions: ".$width." x ".$height."";

} else {

...
The PHP is not seeming to get the dimentions of the image at all. When simply echo-ing the width and height, nothing appears.

Whe, then if the image is the correct dimentions, queries the data into a MySQL database. This is all through using PHP.

This is what I've got:

Code: Select all

<form method="POST" action="edit.php?action=admin_submit" name="admin_submit" enctype="multipart/form-data">

...

&lt;input class=&quote;text&quote; type=&quote;file&quote; name=&quote;Photo&quote; style=&quote;width: 280px;&quote;&gt;

Code: Select all

$size = getimagesize($_FILES&#1111;'Photo']&#1111;'name']);
$height = $size&#1111;1];
$width = $size&#1111;0];

if (($width != 168) || ($height != 134)){
	print &quote;Your photo does not have the ition, checks the dimentions of an image, then if the image is the correct dimentions, queries the data into a MySQL database. This is all through using PHP.

This is what I've got:

Code: Select all

<form method="POST" action="edit.php?action=admin_submit" name="admin_submit" enctype="multipart/form-data">

...

<input class="text" type="file" name="Photo" style="width: 280px;">

Code: Select all

$size = getimagesize($_FILES&#1111;'Photo']&#1111;'name']);
$height = $size&#1111;1];
$width = $size&#1111;0];

if (($width != 168) || ($height != 134)){
	print &quote;Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.&lt;br /&gt;&lt;br /&gt; Your photos current dimentions: &quote;.$width.&quote; x &quote;.$height.&quote;&quote;;

} else {

...
The PHP is not seeming to get the dimentions of the image at all. When simply echo-ing the width and height, nothing appears.

Why the heck doesn't this work?amp;gt;

...

<input class="text" type="file" name="Photo" style="width: 280px;"&gt;

Code: Select all

$size = getimagesize($_FILES&#1111;'Photo']&#1111;'name']);
$height = $size&#1111;1];
$width = $size&#1111;0];

if (($width != 168) || ($height != 134)){
	print &his is all through using PHP.

This is what I've got:

Code: Select all

<form method="POST" action=&quote;edit.php?action=admin_submit&quote; name=&quote;admin_submit&quote; enctype=&quote;multipart/form-data&quote;&gt;

...

&lt;input class=&quote;text&quote; type=&quote;file&quote; name=&quote;Photo&quote; style=&quote;width: 280px;&quote;&gt;

Code: Select all

$size = getimagesize($_FILES&#1111;'Photo']&#1111;'name']);
$height = $size&#1111;1];
$width = $size&#1111;0];

if (($width != 168) || ($height != 134)){
	print &quote;Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.&lt;br /&gt;&lt;br /&gt; Your photos current dimentions: &quote;.$width.&quote; x &quote;.$height.&quote;&quote;;

} else {

...

[/ns, queries the data into a MySQL database. This is all through using PHP.

This is what I've got:

Code: Select all

<form method="POST" action="edit.php?action=admin_submit" name="admin_submit" enctype="multipart/form-data">

...

<input class="text" type="file" name="Photo" style="width: 280px;">

Code: Select all

$size = getimagesize($_FILES['Photo']['name']);
$height = $size[1];
$width = $size[0];

if (($width != 168) || ($height != 134)){
	print "Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.<br /><br /> Your photos current dimentions: ".$width." x ".$height."";

} else {

...
The PHP is not seeming to get the dimentions of the image at all. When simply echo-ing the width and height, nothing appears.

Wh, checks the dimentions of an image, then if the image is the correct dimentions, queries the data into a MySQL database. This is all through using PHP.

This is what I've got:

Code: Select all

<form method="POST" action="edit.php?action=admin_submit" name="admin_submit" enctype="multipart/form-data">

...

<input class="text" type="file" name="Photo" style="width: 280px;">

Code: Select all

$size = getimagesize($_FILES['Photo']['name']);
$height = $size[all through using PHP.

This is what I've got:

Code: Select all

&lt;form method="POST&quote; action=&quote;edit.php?action=admin_submit&quote; name=&quote;admin_submit&quote; enctype=&quote;multipart/form-data&quote;&gt;

...

&lt;input class=&quote;text&quote; type=&quote;file&quote; name=&quote;Photo&quote; style=&quote;width: 280px;&quote;&gt;

Code: Select all

$size = getimagesize($_FILES&#1111;'Photo']&#1111;'name']);
$height = $size&#1111;1];
$width = $size&#1111;0];

if (($width != 168) || ($height != 134)){
	print &quote;Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.&lt;br /&gt;&lt;br /&gt; Your photos current dimentions: &quote;.$width.&quote; x &quote;.$height.&quote;&quote;;

} emage is the correct dimentions, queries the data into a MySQL database. This is all through using PHP.

This is what I've got:

Code: Select all

<form method="POST" action="edit.php?action=admin_submit&quote; name=&quote;admin_submit&quote; enctype="multipart/form-data">

...

<input class="text" type="file" name="Photo" style="width: 280px;">

Code: Select all

$size = getimagesize($_FILES['Photo']['name']);
$height = $size[1];
$width = $size[0];

if (($width != 168) || ($height != 134)){
	print "Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.<br /><br /> Your photos current dimentions: ".$width." x ".$height."";

} else {

...
The PHP is not seeming to get the dimentions of the image at all. When simply echo-ing the width and height, nothing appears.

Why the heck doesn't this work?a">

...

<input class="text" type="file" name="Photo" style="width: 280px;">

Code: Select all

$size = getimagesize($_FILES['Photo']['name']);
$height = $size[1];
$width = $size[0];

if (($width != 168) || ($height != 134)){
	print "Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.<br /><br /> Your photos current dimentions: ".$width.&aubmit" enctype="multipart/form-data">

...

<input class="text" type=&quote;file&quote; name=&quote;Photo&quote; style=&quote;width: 280px;&quote;&gt;

Code: Select all

$size = getimagesize($_FILES&#1111;'Photo']&#1111;'name']);
$height = $size&#1111;1];
$width = $size&#1111;0];

if (($width != 168) || ($height != 134)){
	print &quote;Your photo does not have the proper dimentions. Please upload a 168 x 134 pi data into a MySQL database. This is all through using PHP.

This is what I've got:

Code: Select all

<form method="POST" action="edit.php?action=admin_submit" name="admin_submit" enctype="multipart/form-data">

...

<input class="text" type="file" name="Photo" style="width: 280px;">

Code: Select all

$size = getimagesize($_FILES['Photo']['name']);
$height = $size[1];
$width = $size[0];

if (($width != 168) || ($height != 134)){
	print &quotehrough using PHP.

This is what I've got:

Code: Select all

<form method="POST&quote; action=&quote;edit.php?action=admin_submit&quote; name=&quote;admin_submit&quote; enctype=&quote;multipart/form-data&quote;&gt;

...

&lt;input class=&quote;text&quote; type=&quote;file&quote; name=&quote;Photo&quote; style=&quote;width: 280px;&quote;&gt;

Code: Select all

$size = getimagesize($_FILES&#1111;'Photo']&#1111;'name']);
$height = $size&#1111;1];
$width = $size&#1111;0];

if (($width != 168) || ($height != 134)){
	print &quote;Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.&lt;br /&gt;&lt;br /&gt; Your photos current dimentions: &quote;.$width.&quote; x &quote;.$height.&quote;";

} else {

...
The PHP is not seeming to get the dimentions of the image at all. When simply echo-ing the width andthe correct dimentions, queries the data into a MySQL database. This is all through using PHP.

This is what I've got:

Code: Select all

&lt;form method=&quote;POST&quote; action=&quote;edit.php?action=admin_submit&quote; name=&quote;admin_submit&quote; enctype=&quote;multipart/form-data&quote;&gt;

...

&lt;input class=&quote;text&quote; type=&quote;file&quote; name=&quote;Photo&quote; style=&quote;width: 280px;&quote;&gt;

Code: Select all

$size = getimagesize($_FILES['Photo']['name']);
$height = $size[1];
$width = $size[0];

if (($width != 168) || ($height != 134)){
	print "Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.<br /><br /> Your photos current dimentions: ".$width." x ".$height."";

} else {

...
The PHP is not seeming to get the dimentiontions, queries the data into a MySQL database. This is all through using PHP.

This is what I've got:

Code: Select all

<form method="POST" action="edit.php?action=admin_submit" name="admin_submit" enctype="multipart/form-data">

...

<input class="text" type="file" name="Photo" style="width: 280px;">

Code: Select all

$size = getimagesize($_FILES&#1111;'Photo']&#1111;'name']);
$height =mage, then if the image is the correct dimentions, queries the data into a MySQL database. This is all through using PHP.

This is what I've got:

Code: Select all

<form method="POST" action="edit.php?action=admin_submit" name="admin_submit" enctype="multipart/form-data">

...

<input class=&quote;text&quote; type=&quote;file&quote; name=&quote;Photo&quote; style=&quote;width: 280px;&quote;&gt;

Code: Select all

$size = getimagesize($_FILES&#1111;'Photo']&#1111;'name']);
$height = $size&#1111;1];
$width = $size&#1111;0];

if (($width != 168) || ($height != 134)){
	print &quote;Your photo does not have the proper didimentions of an image, then if the image is the correct dimentions, queries the data into a MySQL database. This is all through using PHP.

This is what I've got:

Code: Select all

<form method="POST" action="edit.php?action=admin_submit&quote; name=&quote;admin_submit&quote; enctype=&quote;multipart/form-data&quote;&gt;

...

&lt;input class=&quote;text&quote; type=&quote;file&quote; name=&quote;Photo&quote; style=&quote;width: 280px;&quote;&gt;

Code: Select all

$size = getimagesize($_FILES&#1111;'Photo']&#1111;'name']);
$height = $size&#1111;1];
$width = $size&#1111;0];

if (($width != 168) || ($height != 134)){
	print &quote;Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.&lt;br /&gt;&lt;br /&gt; Your photos current dimentions: &quote;.$width.&quote; x &quote;.$heig the correct dimentions, queries the data into a MySQL database. This is all through using PHP.

This is what I've got:

Code: Select all

<form method="POST" action="edit.php?action=admin_submit" name="admin_submit" enctype="multipart/form-data">

...

<input class="text" type="file" name="Photo" style="width: 280px;&quote;&gt;

Code: Select all

$size = getimagesize($_FILES['Photo']['name']);
$height = $size&#1111;using PHP.

This is what I've got:

Code: Select all

<form method="POST" action="edit.php?action=admin_submit" name="admin_submit" enctype="multipart/form-data">

...

<input class="text" type=&quote;file&quote; name=&quote;Photo&quote; style=&quote;width: 280px;&quote;&gt;

Code: Select all

$size = getimagesize($_FILES['Photo']['name']);
$height = $size[1];
$width = $size[0];

if (($width != 168) || ($height != 134)){
	print "Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.<br /><br /> Your photos current dimentions: ".$width." x ".$height."";

} else {

...
The PHP is not seeming to get the die="multipart/form-data">

...

<input class="text" type="file" name="Photo" style="width: 280px;&quote;&gt;

Code: Select all

$size = getimagesize($_FILES['Photo']['name']);
$height = $size[1];
$width = $size[0];

if (($width != 168) || ($height != 134)){
	print "Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.<br /><br /> Your photos current dimentions: ".$width." x ".$height."";

} else {

...
The PHP is not seeming to get the dimentions of the image at all. When simply echo-ing the width and height, nothing appears.

Why the heck doesn't this work?mage, then if the image is the correct dimentions, queries the data into a MySQL database. This is all through using PHP.

This is what I've got:

Code: Select all

&lt;form method=&quote;POST&quote; action="edit.php?action=admin_submit&quote; name=&quote;admin_submit&quote; enctype=&quote;multipart/form-data&quote;&gt;

...

&lt;input class=&quote;text&quote; type=&quote;file&quote; name=&quote;Photo&quote; style=&quote;width: 280px;&quote;&gt;

Code: Select all

$size = getimagesize($_FILES['Photo']['name']);
$height = $size[1];
$width =ons of an image, then if the image is the correct dimentions, queries the data into a MySQL database. This is all through using PHP.

This is what I've got:

Code: Select all

<form method="POST" action="edit.php?action=admin_submit" name="admin_submit" enctype="multipart/form-data">

...

<input class="text" type="file" name="Photo" style="width: 280px;">

Code: Select all

$size = getimagesize($_FILES['Photo']['name']);
$height = $size[1];
$width = $size[0];

if (($width != 168) || ($height != 134)){
	print "Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.<br /><br /> Your photos current dimentions: ".$width." x ".$height."";

} else {

...
The PHP is not seeming to get the dimentions of the image at all. When simply echo-ing the width and height, nothing appears.

Why the heck doesn't this work?.php?action=admin_submit" name="admin_submit" enctype="multipart/form-data">

...

<input class="text" type="file" name="Photo" style="width: 280px;">

Code: Select all

$size = getimagesize($_FILES['Photo']['name']);
$height = $size&#1111on submition, checks the dimentions of an image, then if the image is the correct dimentions, queries the data into a MySQL database. This is all through using PHP.

This is what I've got:

Code: Select all

<form method="POST" action="edit.php?action=admin_submit" name="admin_submit" enctype="multipart/form-data">

...

<input class="text" type="file&quote; name=&quote;Photo&quote; style=&quote;width: 280px;&quote;&gt;

Code: Select all

$size = getimagesize($_FILES&#1111;'Photo']&#1111;'name']);
$height = $size&#1111;1];
$width = $size&#1111;0];

if (($width != 168) || ($height != 134)){
	print &quote;Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.&lt;br /&gt;&lt;br /&gt; Your photos current dimentions: ".$width." x ".$height."";

} else {

...
The PHP is not seeming to get the dimentions of the image at all. When simplyform method="POST" action="edit.php?action=admin_submit" name=&quote;admin_submit&quote; enctype=&quote;multipart/form-data&quote;&gt;

...

&lt;input class=&quote;text&quote; type=&quote;file&quote; name=&quote;Photo&quote; style=&quote;width: 280px;&quote;&gt;

Code: Select all

$size = getimagesize($_FILES&#1111;'Photo']&#1111;'name']);
$height = $size&#1111;1];
$width = $size&#1111;0];

if (($width != 168) || ($height != 134)){
	print &quote;Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.&lt;br /&gt;&lt;br /&gt; s the dimentions of an image, then if the image is the correct dimentions, queries the data into a MySQL database. This is all through using PHP.

This is what I've got:

Code: Select all

<form method="POST" action="edit.php?action=admin_submit" name="admin_submit" enctype="multipart/form-data">

...

&lt;input class=&quote;text&quote; type=&quote;file&quote; name=&quote;Photo&quote; style=&quote;width: 280px;&quote;&gt;

Code: Select all

$size = getimagesize($_FILES&#1111;'Photo']&#1111;'name']);
$height = $size&#1111;1];
$width = $size&#1111;0];

if (($width != 168) || ($height != 134)){
	print &quote;Your photo does not have the proper dimentions. Please upload a 168 x 1 image, then if the image is the correct dimentions, queries the data into a MySQL database. This is all through using PHP.

This is what I've got:

Code: Select all

<form method="POST" action="edit.php?action=admin_submit" name="admin_submit" enctype="multipart/form-data">

...

<input class="text" type=&quote;file&quote; name=&quote;Photo&quote; style=&quote;width: 280px;&quote;&gt;

Code: Select all

$size = getimagesize($_FILES&#1111;'Photo']&#1111;'name']);
$height = $size&#1111;1];
$width = $size&#1111;0];

if (($width != 168) || ($height != 134)){
	print &quote;Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.&lt;br /&gt;&lt;br /&gt; Your photos current 0a85c]
<form method="POST" action="edit.php?action=admin_submit" name="admin_submit" enctype="multipart/form-data">

...

<input class="text&quote; type=&quote;file&quote; name=&quote;Photo&quote; style=&quote;width: 280px;&quote;&gt;

Code: Select all

$size = getimagesize($_FILES['Photo']['name']);
$height = $size[1];
$width = $size[0];

if (($width != 168) || ($height != 134)){
	print "Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.<br /><br /> Your phot
$size = getimagesize($_FILES['Photo']['name']);
$height = $size[1];
$width = $size[0];

if (($width != 168) || ($height != 134)){
	print "Your photo does not have the proper dimentions. Please upload a 168 x 134 pixled photo.<br /><br /> Your photos current dimentions: ".$width." x ".$height."";

} else {

...
The PHP is not seeming to get the dimentions of the image at all. When simply echo-ing the width and height, nothing appears.

Why the heck doesn't this work?
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

When uploading a file, it is stored in a temporary folder.

You should move the file to a specified location first, then use the getimagesize() function.

For example getimagesize("/home/user/public_html/photos/uploadedfile.jpg");
iamkoa
Forum Newbie
Posts: 11
Joined: Sun Feb 06, 2005 11:36 pm

Post by iamkoa »

Thanks for the help! I know I'm asking a lot, but how would I move the image to a folder, check its size, then if the size IS NOT correct, delete the image?
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

use move_uploaded_file() then getimagesize(), if it's not the right size, use unlink() to delete it.

8O
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

Generically, it would go something like this.

Code: Select all

// Set upload directory and move file to designated path

$upload_dir = "path/to/dir";
if(is_uploaded_file($_FILES['filetoupload']['tmp_name']))
{
       $time = time(); // for the purpose of a random filename
	$filename2 = $_FILES['filetoupload']['name'];
	$extension = strtolower(strrchr($filename2,"."));
	$extensions = array('.ext','.ext','.ext'); // edit to your liking
	if(!in_array($extension, $extensions))
	{
		die("File type not allowed.");
	}
	$filename = $time.$ext; 
	move_uploaded_file($_FILES['filetoupload']['tmp_name'],$upload_dir.$filename)

     // Check image size
     $size = getimagesize("/home/username/public_html/path/to/dir/$filename");
     $width = $size[0];
     $height = $size[1];

     if(($width >= 180) || ($height >= 180)  // just an example, change to your liking
     {
          unlink("/home/username/public_html/path/to/dir/$filename");
          die("Your file was not the proper dimensions");
     } ELSE
     {
          echo "Your file has been uploaded.";
          // Insert your query here to update database information
     }
}
Hope that helps a little bit.

But, I think you should note that if you're looking for images that are 168x134 exactly, you're going to get a bunch of rejections. Not many images uploaded will be exactly that size.

Code: Select all

// Set upload directory and move file to designated path

$upload_dir = "path/to/dir";
if(is_uploaded_file($_FILES['filetoupload']['tmp_name']))
{
       $time = time(); // for the purpose of a random filename
	$filename2 = $_FILES['filetoupload']['name'];
	$extension = strtolower(strrchr($filename2,"."));
	$extensions = array('.ext','.ext','.ext'); // edit to your liking
	if(!in_array($extension, $extensions))
	{
		die("File type not allowed.");
	}
	$filename = $time.$ext; 
	move_uploaded_file($_FILES['filetoupload']['tmp_name'],$upload_dir.$filename)

     // Check image size
     $size = getimagesize("/home/username/public_html/path/to/dir/$filename");
     $width = $size[0];
     $height = $size[1];

     if(($width >= 180) || ($height >= 180)  // just an example, change to your liking
     {
          unlink("/home/username/public_html/path/to/dir/$filename");
          die("Your file was not the proper dimensions");
     } ELSE
     {
          echo "Your file has been uploaded.";
          // Insert your query here to update database information
     }
}
Hope that helps a litctory and move file to designated path

$upload_dir = "path/to/dir";
if(is_uploaded_file($_FILES['filetoupload']ї'tmp_name']))
{
$time = time(); // for the purpose of a random filename
$filename2 = $_FILESї'filetoupload']ї'name'];
$extension = strtolower(strrchr($filename2,".&quote;));
$extensions = array('.ext','.ext','.ext'); // edit to your liking
if(!in_array($extension, $extensions))
{
die(&quote;File type not allowed.&quote;);
}
$filename = $time.$ext;
move_uploaded_file($_FILESї'filetoupload']ї'tmp_name'],$upload_dir.$filename)

// Check image size
$size = getimagesize(&quote;/home/username/public_html/path/to/dir/$filename&quote;);
$width = $sizeї0];
$height = $sizeї1];

if(($width &gt;= 180) || ($height &gt;= 180) // just an example, change to your liking
{
unlink(&quote;/home/username/public_html/path/to/dir/$filename&quote;);
die(&quote;Your file was not the proper dimensions&quote;);
} ELSE
{
echo &quote;Your file has been uploaded.&quote;;
// Insert = "path/to/dir";
if(is_uploaded_file($_FILES['filetoupload']['tmp_name']))
{
$time = time(); // for the purpose of a random filename
$filename2 = $_FILES['filetoupload']['name'];
$extension = strtolower(strrchr($filename2,&quote;.&quote;));
$extensions = array('.ext','.ext','.ext'); // edit to your liking
if(!in_array($extension, $extensions))
{
die(&quote;File type not allowed.&quote;);
}
$filename = $time.$ext;
move_uploaded_file($_FILESї'filetoupload']ї'tmp_name'],$upload_dir.$filename)

// Check image size
$size = getimagesize(&quote;/home/username/public_html/path/to/dir/$filename&quote;);
$width = $sizeї0];
$height = $sizeї1];

if(($width &gt;= 180) || ($height &gt;= 180) // just an example, change to your liking
{
unlink(&quote;/home/username/public_html/path/to/dir/$filename&quote;);
die(&quote;Your file was not the proper dimensions&quote;);
} ELSE
{
echo &quote;Your file has been uploaded.&quote;;
// Insert your query here to update database informa path

$upload_dir = "path/to/dir";
if(is_uploaded_file($_FILES['filetoupload']['tmp_name']))
{
$time = time(); // for the purpose of a random filename
$filename2 = $_FILES['filetoupload']['name'];
$extension = strtolower(strrchr($filename2,"."));
$extensions = array('.ext','.ext','.ext'); // edit to your liking
if(!in_array($extension, $extensions))
{
die("File type not allowed.");
}
$filename = $time.$ext;
move_uploaded_file($_FILES['filetoupload']ї'tmp_name'],$upload_dir.$filename)

// Check image size
$size = getimagesize(&quote;/home/username/public_html/path/to/dir/$filename&quote;);
$width = $sizeї0];
$height = $sizeї1];

if(($width &guld go something like this.

Code: Select all

// Set upload directory and move file to designated path

$upload_dir = "path/to/dir";
if(is_uploaded_file($_FILES['filetoupload']['tmp_name']))
{
       $time = time(); // for the purpose of a random filename
	$filename2 = $_FILES['filetoupload']['name'];
	$extension = strtolower(strrchr($filename2,"."));
	$extensions = array('.ext','.ext','.ext'); // edit to your liking
	if(!in_array($extension, $extensions))
	{
		die("File type not allowed.");
	}
	$filename = $time.$ext; 
	move_uploaded_file($_FILES['filetoupload']['tmp_name'],$upload_dir.$filename)

     // Check image size
     $size = getimagesize("/home/username/public_html/path/to/dir/$filename");
     $width = $size[0];
     $height = $size[1];

     if(($width >= 180) || ($height >= 180)  // just an example, change to your liking
     {
          unlink("/home/username/public_html/path/to/dir/$filename");
          die("Your file was not the proper dimensions");
     } ELSE
     {
          echo "Your file has been uploaded.";
          // Insert your query here to update database information
     }
}
Hope that helps a little bit.

But, I think you should note that if you're looking for images that are 168x134 exactly, you're going to get a bunch of rejeuld go something like this.

Code: Select all

// Set upload directory and move file to designated path

$upload_dir = "path/to/dir";
if(is_uploaded_file($_FILES['filetoupload']['tmp_name']))
{
       $time = time(); // for the purpose of a random filename
	$filename2 = $_FILES['filetoupload']['name'];
	$extension = strtolower(strrchr($filename2,"."));
	$extensions = array('.ext','.ext','.ext'); // edit to your liking
	if(!in_array($extension, $extensions))
	{
		die("File type not allowed.");
	}
	$filename = $time.$ext; 
	move_uploaded_file($_FILES['filetoupload']['tmp_name'],$upload_dir.$filename)

     // Check image size
     $size = getimagesize("/home/username/public_html/path/to/dir/$filename");
     $width = $size[0];
     $height = $size[1];

     if(($width >= 180) || ($height >= 180)  // just an example, change to your liking
     {
          unlink("/home/username/public_html/path/to/dir/$filename");
          die("Your file was not the proper dimensions");
     } ELSE
     {
          echo "Your file has been uploaded.";
          // Insert your query here to update database information
     }
}
Hope that helps a little bit.

But, I think you should note that if you're looking for images that are 168x134 exactly, yofilename = $time.$ext;
move_uploaded_file($_FILES['filetoupload']['tmp_name'],$upload_dir.$filename)

// Check image size
$size = getimagesize("/home/username/public_html/path/to/dir/$filename");
$width = $size[0];
$height = $size[1];

if(($width >= 180) || ($height >= 180) // just an example, change to your liking
{
unlink("/home/username/public_html/path/to/dir/$filename");
die("Your file was not the proper dimensions");
} ELSE
{
echo "Your file has been uploaded.";
// Insert your query here to update database information
}
}

Hope that helps a little bit.

But, I think you should note that if you're looking for images that are 168x134 exactly, you're going to get a bunch of rejections. Not many images uploaded will be exactly that size.e;);
$width = $size[0];
$height = $size[1];

if(($width >= 180) || ($height >= 180) // just an example, change to your liking
{
unlink("/home/username/public_html/path/to/dir/$filename");
die("Your file was not the proper dimensions");
} ELSE
{
echo "Your file has been uploaded.";
ectory and move file to designated path

$upload_dir = "path/to/dir";
if(is_uploaded_file($_FILES['filetoupload']['tmp_name']))
{
$time = time(); // for the purpose of a random filename
$filename2 = $_FILES['filetoupload']['name'];
$extension = strtolower(strrchr($filename2,"."));
$extensions = array('.ext','.ext','.ext'); // edit to your liking
if(!in_array($extension, $extensions))
{
die("File type not allowed.");
}
$filename = $time.$ext;
move_uploaded_file($_FILES['filetoupload']['tmp_name'],$upload_dir.$filename)

// Check image size
$size = getimagesize(&quote;/home/username/public_html/path/to/dir/$filename&quote;);
$width = $sizeї0];
$height = $sizeї1];

designated path

$upload_dir = "path/to/dir";
if(is_uploaded_file($_FILES['filetoupload']['tmp_name']))
{
$time = time(); // for the purpose of a random filename
$filename2 = $_FILESї'filetoupload']['name'];
$extension = strtolower(strrchr($filename2,"."));
$extensions = array('.ext','.ext','.ext'); // edit to your liking
if(!in_array($extension, $extensions))
{
die(&quote;File type not allowed.&quote;);
}
$filename = $time.$ext;
move_uploaded_file($_FILESї'filetoupload']ї'tmp_name'],$upload_dir.$filename)

// Check image size
$size = getimagesize(&quote;/home/username/public_html/path/to/dir/$filename&quote;);
$width = $sizeї0];
$height = $sizeї1];

if(($width &gt;= 180) || ($height &gt;= 180) // just an example, change to your liking
{
unlink(&quote;/home/username/public_html/path/to/dir/$filename&quote;);
die(&quote;Your file was not the proped52d912a2]

// Set upload directory and move file to designated path

$upload_dir = "path/to/dir";
if(is_uploaded_file($_FILES['filetoupload']['tmp_name']))
{
$time = time(); // for the purpose of a random filename
$filename2 = $_FILES['filetoupload']['name'];
$extension = strtolower(strrchr($filename2,"."));
$extensions = array('.ext','.ext','.ext'); // edit to your liking
if(!in_array($extension, $extensions))
{
die(&quote;File type not allowed.");
}
$filename = $time.$ext;
move_uploaded_file($_FILES['filetoupload']['tmp_name'],$upload_dir.$filename)

// Check image size
$size = getimagesize("/home/username/public_html/path/to/dir/$filename");
$width = $size[0];
$height = $size[1];

if(($width >= 180) || ($height >= 180) // just an example, change to your liking
{
unlink("/home/username/public_html/path/to/dir/$filename&q#1111;'filetoupload']['tmp_name']))
{
$time = time(); // for the purpose of a random filename
$filename2 = $_FILES['filetoupload']['name'];
$extension = strtolower(strrchr($filename2,"."));
$extensions = array('.ext','.ext','.ext'); // edit to your liking
if(!in_array($extension, $extensions))
{
die(&quote;File type not allowed.&quote;);
}
$filename = $time.$ext;
move_uploaded_file($_FILESї'filetoupload']ї'tmp_name'],$upload_dir.$filename)

// Check image size
$size = getimagesize(&quote;/home/username/public_html/path/to/dir/$filename&quote;);
$width = $sizeї0];
$height = $sizeї1];

if(($width &gt;= 180) || ($height &gt;= 180) // just an example, change to your liking
{
unlink(&quote;/home/username/public_html/path/to/dir/$filename&quote;);
die(&quote;Your file was not the proper dimensions&quote;);
} ELSE
{
echo &quote;Your file has been uploaded.&quote;;
// Insert your query here to update database information
}
}

Hope that helps a little bit.

But, I think you should note that if you're looking for images that are 168x134 exactly, you're going toe'];
$extension = strtolower(strrchr($filename2,"."));
$extensions = array('.ext','.ext','.ext'); // edit to your liking
if(!in_array($extension, $extensions))
{
die("File type not allowed.");
}
$filename = $time.$ext;
move_uploaded_file($_FILES['filetoupload']['tmp_name'],$upload_dir.$filename)

// Check image size
$size = getimagesize("/home/username/public_html/path/to/dir/$filename");
$width = $size[0];
$height = $size[1];

if(($wiing like this.

Code: Select all

// Set upload directory and move file to designated path

$upload_dir = "path/to/dir";
if(is_uploaded_file($_FILES['filetoupload']['tmp_name']))
{
       $time = time(); // for the purpose of a random filename
	$filename2 = $_FILES['filetoupload']['name'];
	$extension = strtolower(strrchr($filename2,"."));
	$extensions = array('.ext','.ext','.ext'); // edit to your liking
	if(!in_array($extension, $extensions))
	{
		die("File type not allowed.");
	}
	$filename = $time.$ext; 
	move_uploaded_file($_FILES['filetoupload']['tmp_name'],$upload_dir.$filename)

     // Check image size
     $size = getimagesize("/home/username/public_html/path/to/dir/$filename");
     $width = $size[0];
     $height = $size[1];

     if(($width >= 180) || ($height >= 180)  // just an example, change to your liking
     {
          unlink("/home/username/public_html/path/to/dir/$filename");
          die("Your file was not the proper dimensions");
     } ELSE
     {
          echo "Your file has been uploaded.";
          // Insert your query here to update database information
     }
}
Hope that helps a little bit.

But, I think you should note that if you're looking for images that are 168x134 exactly, you're going to get a bunch of rejections. Not many images uploaded will be exactly that size.time(); // for the purpose of a random filename
$filename2 = $_FILES['filetoupload']['name'];
$extension = strtolower(strrchr($filename2,&quote;.&quote;));
$extensions = array('.ext','.ext','.ext'); // edit to your liking
if(!in_array($extension, $extensions))
{
die(&quote;File type not allowed.&quote;);
}
$filename = $time.$ext;
move_uploaded_file($_FILESї'filetoupload']ї'tmp_name'],$upload_dir.$filename)

// Check image size
$size = getimagesize(&quote;/home/username/public_html/path/to/dir/$filename&quote;);
$width = $sizeї0];
$height = $sizeї1];

if(($width &gt;= 180) || ($height &gt;= 180) // just an example, change to your liking
{
unlink(&quote;/home/username/public_html/path/to/dir/$filename&quote;);
die(&quote;Your file was not the proper dimensions&quote;);
} ELSE
{
echo &quote;Your file has been uploaded.&quote;;
// Insert your query here to update database information
}
}

Hope that helps a little bit.

But, I think you should note that if you're looking for images that are 168x134 exactly, you're going to get a bunch of rejections. Not many images uploaded wilolower(strrchr($filename2,"."));
$extensions = array('.ext','.ext','.ext'); // edit to your liking
if(!in_array($extension, $extensions))
{
die("File type not allowed.");
}
$filename = $time.$ext;
move_uploaded_file($_FILES['filetoupload']['tmp_name'],$upload_dir.$filename)

// Check image size
$size = getimagesize("/home/username/public_html/path/to/dir/$filename");
$width = $size[0];
$height = $size[1];

if(($width >= 180) || ($height >= 180) // just an example, change to your liking
{
unlink("/home/username/public_html/path/to/dir/$filename");
die("Your file was not the proper dimensions");
} ELSE
{
echo "Your file has been uploaded.";
// Insert your query here to update database information
}
}

Hope that helps a little bit.

But, I think you should note that if you're looking for images that are 168x134 exactly, you're going to get a bunch of rejections. Not many images uploaded will be exactly that size.e("/home/username/public_html/path/to/dir/$filename");
$width = $size[0];
$height = $size[1];

if(($width >= 180) || ($height >= 180) // just an example, change to your liking
{
unlink("/home/username/public_html/path/to/dir/$filename");
die("Your file was not the proper dimensions");
} ELSE
{
echo "Your file has been uploaded.";
// Insert your query here to update database information
}
}

Hope that helps a little bit.

But, I think you should note that if you're looking for images that are 168x134 exactly, you're going to get a bunch of rejections. Not many images uploaded will be exactly that size.oupload']['tmp_name']))
{
$time = time(); // for the purpose of a random filename
$filename2 = $_FILES['filetoupload']['name'];
$extension = strtolower(strrchr($filename2,"."));
$extensions = array('.ext','.ext','.ext'); // edit to your liking
if(!in_array($extension, $extensions))
{
die(&quote;File type not allowed.&quote;);
}
$filename = $time.$ext;
move_uploaded_file($_FILESї'filetoupload']ї'tmp_name'],$upload_dir.$filename)

// Check image size
$size = getimagesize(&quote;/home/username/public_html/path/to/dir/$filename&quote;);
$width = $sizeї0];
$height = $sizeї1];

if(($width &gt;= 180) || ($height &gt;= 180) // just an example, change to your liking
{
unlink(&quote;/home/username/public_html/path/to/dir/$filename&quote;);
die(&quote;Your file was not the proper dimensions&quote;);
} ELSE
{
echo &quote;Your file has been uploaded.&quote;;
// Insert your query here to update database information
}
}

Hope that helps a litt of a random filename
$filename2 = $_FILES['filetoupload']['name'];
$extension = strtolower(strrchr($filename2,"."));
$extensions = array('.ext','.ext','.ext'); // edit to your liking
if(!in_array($extension, $extensions))
{
die("File type not allowed.");
}
$filename = $time.$ext;
move_uploaded_file($_FILES['filetoupload']['tmp_name'],$upload_dir.$filename)

// Check image size
$size = getimagesize("/home/username/public_html/path/to/dir/$filename");
$width = $size[0];
$height = $size[1];

if(($width &gt;= 180) || ($height &gt;= 180) // just an example, change to your liking
{
unlink(&quote;/home/username/public_html/path/to/dir/$filename&quote;);
die(&quote;Your file was not the proper dimensions&quote;);
} ELSE
{
echo &qunot allowed.");
}
$filename = $time.$ext;
move_uploaded_file($_FILES['filetoupload']['tmp_name'],$upload_dir.$filename)

// Check image size
$size = getimagesize("/home/username/public_html/path/to/dir/$filename");
$width = $size[0];
$height = $size[1];

if(($width >= 180) || ($height >= 180) // just an example, change to your liking
{
unlink("/home/username/public_html/path/to/dir/$filename");
die("Your file was not the proper dimensions&quuld go something like this.

Code: Select all

// Set upload directory and move file to designated path

$upload_dir = "path/to/dir";
if(is_uploaded_file($_FILES['filetoupload']['tmp_name']))
{
       $time = time(); // for the purpose of a random filename
	$filename2 = $_FILES['filetoupload']['name'];
	$extension = strtolower(strrchr($filename2,"."));
	$extensions = array('.ext','.ext','.ext'); // edit to your liking
	if(!in_array($extension, $extensions))
	{
		die("File type not allowed.");
	}
	$filename = $time.$ext; 
	move_uploaded_file($_FILES['filetoupload']['tmp_name'],$upload_dir.$filename)

     // Check image size
     $size = getimagesize("/home/username/public_html/path/to/dir/$filename");
     $width = $size[0];
     $height = $size[1];

     if(($width >= 180) || ($height >= 180)  // just an example, change to your liking
     {
          unlink("/home/username/public_html/path/to/dir/$filename");
          die("Your file was not the proper dimensions");
     } ELSE
     e;));
	$extensions = array('.ext','.ext','.ext'); // edit to your liking
	if(!in_array($extension, $extensions))
	{
		die("File type not allowed.");
	}
	$filename = $time.$ext; 
	move_uploaded_file($_FILES['filetoupload']['tmp_name'],$upload_dir.$filename)

     // Check image size
     $size = getimagesize("/home/username/public_html/path/to/dir/$filename");
     $width = $size[0];
     $height = $size[1];

     if(($width >= 180) || ($height >= 180)  // just an example, change to your liking
     {
          unlink("/home/username/public_html/path/to/dir/$filename");
          die("Your file was not the proper dimensions");
     } ELSE
     {
          echo "Your file has been uploaded.";
          // Insert your query here to update database information
     }
}
Hope that helps a little bit.

But, I think you should note that if you're looking for images that are 168x134 exactly, you're going to get a bunch of rejections. Not many images uploaded will be exactly that size.

Code: Select all

// Set upload directory and move file to designated path

$upload_dir = "path/to/dir";
if(is_uploaded_file($_FILES['filetoupload']['tmp_name']))
{
       $time = time(); // for the purpose of a random filename
	$filename2 = $_FILES['filetoupload']['name'];
	$extension = strtolower(strrchr($filename2,"."));
	$extensions = array('.ext','.ext','.ext'); // edit to your liking
	if(!in_array($extension, $extensions))
	{
		die("File type not allowed.");
	}
	$filename = $time.$ext; 
	move_uploaded_file($_FILES['filetoupload']['tmp_name'],$upload_dir.$filename)

     // Check image size
     $size = getimagesize("/home/username/public_html/path/to/dir/$filename");
     $width = $size[0];
     $height = $size[1];

     if(($width >= 180) || ($height >= 180)  // just an example, change to your liking
     {
          unlink("/home/username/public_html/path/to/dir/$filename");
          die("Your file was not the proper dimensions");
     } ELSE
     {
          echo "Your file has been uploaded.";
          // Insert your query here to update database information
     }
}
Hope that helps a little bit.

But, I think you should note that if you're looking for images that are 168x134 exactly, you're going to get a bunch of rejeaded_file($_FILES['filetoupload']['tmp_name']))
{
$time = time(); // for the purpose of a random filename
$filename2 = $_FILES['filetoupload']['name'];
$extension = strtolower(strrchr($filename2,"."));
$extensions = array('.ext','.ext','.ext'); // edit to your liking
if(!in_array($extension, $extensions))
{
die("File type not allowed.");
}
$filename = $time.$ext;
move_uploaded_file($_FILES['filetoupload']['tmp_name'],$upload_dir.$filename)

// Check image size
$size = getimagesize("/home/username/public_html/path/to/dir/$filename");
$width = $size[0];
$height = $size[1];

if(($width >= 180) || ($height >= 180) // just an example, change to your liking
{
unlink("/home/username/public_html/path/to/dir/$filename");
die("Your file was not the proper dimensions");
} ELSE
{
echo "Your file has been uploaded.";
// Insert your query here to update database information
}
}

Hope that helps a little bit.

But, I think you should note that if you're looking for images that are 168x134 exactly, you're going to get a bunch of rejections. Not many images uploaded will be exactly that size.

Code: Select all

// Set upload directory and move file to designated path

$upload_dir = "path/to/dir";
if(is_uploaded_file($_FILES['filetoupload']['tmp_name']))
{
       $time = time(); // for the purpose of a random filename
	$filename2 = $_FILES['filetoupload']['name'];
	$extension = strtolower(strrchr($filename2,"."));
	$extensions = array('.ext','.ext','.ext'); // edit to your liking
	if(!in_array($extension, $extensions))
	{
		die("File type not allowed.");
	}
	$filename = $time.$ext; 
	move_uploaded_file($_FILES['filetoupload']['tmp_name'],$upload_dir.$filename)

     // Check image size
     $size = getimagesize("/home/username/public_html/path/to/dir/$filename");
     $width = $size[0];
     $height = $size[1];

     if(($width >= 180) || ($height >= 180)  // just an example, change to your liking
     {
          unlink("/home/username/public_html/path/to/dir/$filename");
          die("Your file was not the proper dimensions");
     } ELSE
     {
          echo "Your file has been uploaded.";
          // Insert your query here to update database information
me']))
{
       $time = time(); // for the purpose of a random filename
	$filename2 = $_FILES['filetoupload']['name'];
	$extension = strtolower(strrchr($filename2,"."));
	$extensions = array('.ext','.ext','.ext'); // edit to your liking
	if(!in_array($extension, $extensions))
	{
		die("File type not allowed.");
	}
	$filename = $time.$ext; 
	move_uploaded_file($_FILES['filetoupload']['tmp_name'],$upload_dir.$filename)

     // Check image size
     $size = getimagesize("/home/username/public_html/path/to/dir/$filename");
     $width = $size[0];
     $height = $size[1];

     if(($width >= 180) || ($height >= 180)  // just an example, change to your liking
    filetoupload']['tmp_name']))
{
       $time = time(); // for the purpose of a random filename
	$filename2 = $_FILES['filetoupload']['name'];
	$extension = strtolower(strrchr($filename2,"."));
	$extensions = array('.ext','.ext','.ext'); // edit to your liking
	if(!in_array($extension, $extensions))
	{
		die("File type not allowed.");
	}
	$filename = $time.$ext; 
	move_uploaded_file($_FILES['filetoupload']['tmp_name'],$upload_dir.$filename)

     // Check image size
     $size = getimagesize("/home/username/public_html/path/to/dir/$filename");
     $width = $size[0];
     $height = $size[1];

     if(($width >= 180) || ($height >= 180)  // just an example, change to your liking
     {
          unlink("/home/username/public_html/path/to/dir/$filename");
          die("Your file was not the proper dimensions");
     } ELSE
     {
          echo "Your file has been uploaded.";
          // Insert your query here to update database information
     }
}
Hope that helps a little bit.

But, I think you should note that if you're looking for images that are 168x134 exactly, you'reensions = array('.ext','.ext','.ext'); // edit to your liking
if(!in_array($extension, $extensions))
{
die(&quote;File type not allowed.&quote;);
}
$filename = $time.$ext;
move_uploaded_file($_FILES['filetoupload']['tmp_name'],$upload_dir.$filename)

// Check image size
$size = getimagesize("/home/username/public_html/path/to/dir/$filename&quote;);
$width = $sizeї0];
$height = $sizeї1];

if(($width &gt;= 180) || ($height &gt;= 180) // just an example, change to your liking
{
unlink(&quote;/home/username/public_html/path/to/dir/$filename&quo111;'name'];
$extension = strtolower(strrchr($filename2,"."));
$extensions = array('.ext','.ext','.ext'); // edit to your liking
if(!in_array($extension, $extensions))
{
die("File type not allowed.");
}
$filename = $time.$ext;
move_uploaded_file($_FILES['filetoupload']['tmp_name'],$upload_dir.$filename)

// Check image size
$size = getimagesize("/home/username/public_html/path/to/dir/$filename");
$width = $size&le to designated path

$upload_dir = "path/to/dir";
if(is_uploaded_file($_FILES['filetoupload']['tmp_name']))
{
$time = time(); // for the purpose of a random filename
$filename2 = $_FILES['filetoupload']['name'];
$extension = strtolower(strrchr($filename2,"."));
$extensions = array('.ext','.ext','.ext'); // edit to your liking
if(!in_array($extension, $extensions))
{
die("File type not allowed.");
}
$filename = $time.$ext;
move_uploaded_file($_FILES['filetoupload']['tmp_name'],$upload_dir.$filename)

// Check image size
$size = getimagesize("/home/username/public_html/path/to/dir/$filename");
$width = $size[0];
$height = $size[1];

if(($width >= 180) || ($height >= 180) // just an example, change to your liking
{
unlink("/home/username/public_html/path/to/dir/$filename");
die("Your file was not the proper dimensions");
} ELSE
{
echo "Your file has been uploaded.";
// Insert your query here to update database information
}
}

Hope that helps a little bit.

But, I think you should note that if you're looking for images that are 168x134 exactly, you're going to get a bunch of rejections. Not many images uploaded will be exactly that size.g like this.

Code: Select all

// Set upload directory and move file to designated path

$upload_dir = "path/to/dir";
if(is_uploaded_file($_FILES['filetoupload']['tmp_name']))
{
       $time = time(); // for the purpose of a random filename
	$filename2 = $_FILES['filetoupload']['name'];
	$extension = strtolower(strrchr($filename2,"."));
	$extensions = array('.ext','.ext','.ext'); // edit to your liking
	if(!in_array($extension, $extensions))
	{
		die("File type not allowed.");
	}
	$filename = $time.$ext; 
	move_uploaded_file($_FILES['filetoupload']['tmp_name'],$upload_dir.$filename)

     // Check image size
     $size = getimagesize("/home/username/public_html/path/to/dir/$filename");
     $width = $size[0];
     $height = $size[1];

     if(($width >= 180) || ($height >= 180)  // just an example, change to your liking
     {
          unlink("/home/username/public_html/path/to/dir/$filename");
          die("Your file was not the proper dimensions");
     } ELSE
     {
          echo "Your file has been uploaded.";
          // Insert your query here to update database information
     }
}
Hope that helps a little bit.

But, I think you should note that if you're looking for images that are 168x134 exactly, you're going to get a bunch of rejections. Not many images uploaded will be exactly that size.r(strrchr($filename2,"."));
$extensions = array('.ext','.ext','.ext'); // edit to your liking
if(!in_array($extension, $extensions))
{
die("File type not allowed.");
}
$filename = $time.$ext;
move_uploaded_file($_FILESї'filetoupload']ї'tmp_name'],$upload_dir.$filename)

// Check image size
$size = getimagesize(&quote;/home/username/public_html/path/to/dir/$filenuld go something like this.

Code: Select all

// Set upload directory and move file to designated path

$upload_dir = "path/to/dir";
if(is_uploaded_file($_FILES['filetoupload']['tmp_name']))
{
       $time = time(); // for the purpose of a random filename
	$filename2 = $_FILES['filetoupload']['name'];
	$extension = strtolower(strrchr($filename2,"."));
	$extensions = array('.ext','.ext','.ext'); // edit to your liking
	if(!in_array($extension, $extensions))
	{
		die("File type not allowed.");
	}
	$filename = $time.$ext; 
	move_uploaded_file($_FILES['filetoupload']['tmp_name'],$upload_dir.$filename)

     // Check image size
     $size = getimagesize("/home/username/public_html/path/to/dir/$filename");
     $width = $size[0];
     $height = $size[1];

     if(($width >= 180) || ($height >= 180)  // just an example, change to your liking
     {
          unlink("/home/username/public_html/path/to/dir/$filename");
          die("Your file was not the proper dimensions");
     } ELSE
     {
          echo "Your file has been uploaded.";
          // Insert your query here to update database information
     }
}
Hope that helps a little bit.

But, I think you should note that if you're looking for images that are 168x134 exactly, you're going to ge1;'filetoupload']['tmp_name']))
{
$time = time(); // for the purpose of a random filename
$filename2 = $_FILES['filetoupload']['name'];
$extension = strtolower(strrchr($filename2,"."));
$extensions = array('.ext','.ext','.ext'); // edit to your liking
if(!in_array($extension, $extensions))
{
die(&quote;File type not allowed.&quote;);
}
$filename = $time.$ext;
move_uploaded_file($_FILESї'filetoupload']ї'tmp_name'],$upload_dir.$filename)

// Check image size
$size = getimagesize(&quote;/home/username/public_html/path/to/dir/$filename&quote;);
$width = $sizeї0];
$height = $sizeї1];

if(($width &gt;= 180) || ($height &gt;= 180) // just an example, change to your liking
{
unlink(&quote;/home/username/public_html/path/to/dir/$filename&quote;);
die(&quote;Your file was not the proper dimensions&quote;);
} EL

// Set upload directory and move file to designated path

$upload_dir = "path/to/dir";
if(is_uploaded_file($_FILESї'filetoupload']ї'tmp_name']))
{
$time = time(); // for the purpose of a random filename
$filename2 = $_FILESї'filetoupload']ї'name'];
$extension = strtolower(strrchr($filename2,&quote;.&quote;));
$extensions = array('.ext','.ext','.ext'); // edit to your liking
if(!in_array($extension, $extensions))
{
die(&quote;File type not allowed.&quote;);
}
$filename = $time.$ext;
move_uploaded_file($_FILESї'filetoupload']ї'tmp_name'],$upload_dir.$filename)

// Check image size
$size = getimagesize(&quote;/home/username/public_html/path/to/dir/$filename&quote;);
$width = $sizeї0];
$height = $sizeї1];

if(($width &gt;= 180) || ($height &gt;= 180) // just an example, change to your liking
{
unlink(&quote;/home/username/public_html/path/to/dir/$filename&quote;);
die(&quote;Your file was not the proper dimensions&quote;);
} ELSE
{
echo &quote;Your file has been uploaded.&quote;;
// Insert your query here to update database information
}
}

Hope that helps a little bit.

But, I think you should note that if you're looking for images that are 168x134 exactly, you're going to get a bunch of rejections. Not many images uploaded will be exactly that size(is_uploaded_file($_FILES['filetoupload']ї'tmp_name']))
{
$time = time(); // for the purpose of a random filename
$filename2 = $_FILESї'filetoupload']ї'name'];
$extension = strtolower(strrchr($filename2,&quote;.&quote;));
$extensions = array('.ext','.ext','.ext'); // edit to your liking
if(!in_array($extension, $extensions))
{
die("File type not allowed.");
}
$filename = $time.$ext;
move_uploaded_file($_FILES['filetoupload']['tmp_name'],$upload_dir.$filename)

// Check image size
$size = getimagesize("/home/username/public_html/path/to/dir/$filename");
$width = $size[0];
$height = $size[1];

if(($width >= 180) || ($height >= 180) // just an example, change to your liking
{
unlink("/home/username/public_html/path/to/dir/$filename");
die("Your file was not the proper dimensions");
} ELSE
{
echo "Your file has been uploaded.";
// Insert your query here to update database information
}
}

Hope that helps a little bit.

But, I think you should note that if you're looking for images that are 168x134 exactly, you're going to get a bunch of rejections. Not many images uploaded will be exactly that size.uld go something like this.

Code: Select all

// Set upload directory and move file to designated path

$upload_dir = "path/to/dir";
if(is_uploaded_file($_FILES['filetoupload']['tmp_name']))
{
       $time = time(); // for the purpose of a random filename
	$filename2 = $_FILES['filetoupload']['name'];
	$extension = strtolower(strrchr($filename2,"."));
	$extensions = array('.ext','.ext','.ext'); // edit to your liking
	if(!in_array($extension, $extensions))
	{
		die("File type not allowed.");
	}
	$filename = $time.$ext; 
	move_uploaded_file($_FILES['filetoupload']['tmp_name'],$upload_dir.$filename)

     // Check image size
     $size = getimagesize("/home/username/public_html/path/to/dir/$filename");
     $width = $size[0];
     $height = $size[1];

     if(($width >= 180) || ($height >= 180)  // just an example, change to your liking
     {
          unlink("/home/username/public_html/path/to/dir/$filename");
          die("Your file was not the proper dimensions");
     } ELSE
     {
          echo "Your file has been uploaded.";
          // Insert your query here to update database information
     }
}
Hope that helps a little bit.

But, I think you should note thd_file($_FILES['filetoupload']['tmp_name']))
{
$time = time(); // for the purpose of a random filename
$filename2 = $_FILES['filetoupload']['name'];
$extension = strtolower(strrchr($filename2,&quote;.&quote;));
$extensions = array('.ext','.ext','.ext'); // edit to your liking
if(!in_array($extension, $extensions))
{
die("File type not allowed.");
}
$filename = $time.$ext;
move_uploaded_file($_FILES['filetoupload']['tmp_name'],$upload_dir.$filename)

// Check image size
$size = getimagesize("/home/username/public_html/path/to/dir/$filename");
$width = $sizeї0];
$height = $to/dir";
if(is_uploaded_file($_FILES['filetoupload']['tmp_name']))
{
$time = time(); // for the purpose of a random filename
$filename2 = $_FILES['filetoupload']['name'];
$extension = strtolower(strrchr($filename2,&quote;.&quote;));
$extensions = array('.ext','.ext','.ext'); // edit to your liking
if(!in_array($extension, $extensions))
{
die("File type not allowed.");
}
$filename = $time.$ext;
move_uploaded_file($_FILES['filetoupload']['tmp_name'],$upload_dir.$filename)

// Check image size
$size = getimagesize("/home/username/public_html/path/to/dir/$filename&quote;);
$width = $sizeї0];
$height = $sizeї1];

if(($width &gt;= 180) || ($height &gt;= 180) // just an example, change to your liking
{
unlink(&quote;/home/username/public_html/path/to/dir/$filename&quote;);
die(&quote;Your file was not the proper dimensions&quote;);
} ELSE
{
echo &quote;Your file has been uploaded.&quote;;
// Insert your query here to update database information
}
}[/php:1:3d5te;);
}
$filename = $time.$ext;
move_uploaded_file($_FILES['filetoupload']['tmp_name'],$upload_dir.$filename)

// Check image size
$size = getimagesize("/home/username/public_html/path/to/dir/$filename");
$width = $size[0];
$height = $size[1];

if(($width >= 180) || ($height >= 180) // just an example, change to your liking
{
unlink("/home/username/public_html/path/to/dir/$filename");
die("Your file was not the proper($filename2,"."));
$extensions = array('.ext','.ext','.ext'); // edit to your liking
if(!in_array($extension, $extensions))
{
die("File type not allowed.");
}
$filename = $time.$ext;
move_uploaded_file($_FILES['filetoupload']['tmp_name'],$upload_dir.$filename)

// Check image size
$size = getimagesize("/home/username/public_html/path/to/dir/$filename");
$width = $size[0];
$height = $size[1];

if(($width >= 180) || ($height >= 180) // just an example, change to your liking
{
unlink("/home/username/public_html/path/to/dir/$filename");
die("Your file was not the proper dimensions");
} ELSE
{
echo "Your file has been uploaded.";
// Insert your query here to update database information
}
}

Hope that helps a little bit.

But, I think you should note that if you're looking for images that are 168x134 exactly, you're going to get a bunch of rejections. Not many images uploaded will be exactly that size.
if(is_uploaded_file($_FILES['filetoupload']['tmp_name']))
{
$time = time(); // for the purpose of a random filename
$filename2 = $_FILES['filetoupload']['name'];
$extension = strtolower(strrchr($filename2,"."));
$extensions = array('.ext','.ext','.ext'); // edit to your liking
if(!in_array($extension, $extensions))
{
die("File type not allowed.");
}
$filename = $time.$ext;
move_uploaded_file($_FILES['filetoupload']['tmp_name'],$upload_dir.$filename)

// Check image size
$size = getimagesize("/home/username/public_html/path/to/dir/$filename");
$width = $size[0];
$height = $size[1];

if(($width >= 180) || ($height >= 180) // just an example, change to your liking
{
unlink("/home/username/public_html/path/to/dir/$filename");
die("Your file was not the proper dimensions");
} ELSE
{
echo "Your file has been uploaded.";
// Insert your query here to update database information
}
}

Hope that helps a little bit.

But, I think you should note that if you're looking for images that are 168x134 exactly, you're going to get a bunch of rejections. Not many images uploaded will be exactly that size.uld go something like this.

Code: Select all

// Set upload directory and move file to designated path

$upload_dir = "path/to/dir";
if(is_uploaded_file($_FILES['filetoupload']['tmp_name']))
{
       $time = time(); // for the purpose of a random filename
	$filename2 = $_FILES['filetoupload']['name'];
	$extension = strtolower(strrchr($filename2,"."));
	$extensions = array('.ext','.ext','.ext'); // edit to your liking
	if(!in_array($extension, $extensions))
	{
		die("File type not allowed.");
	}
	$filename = $time.$ext; 
	move_uploaded_file($_FILES['filetoupload']['tmp_name'],$upload_dir.$filename)

     // Check image size
     $size = getimagesize("/home/username/public_html/path/to/dir/$filename");
     $width = $size[0];
     $height = $size[1];

     if(($width >= 180) || ($height >= 180)  // just an example, change to your liking
     {
          unlink("/home/username/public_html/path/to/dir/$filename");
          die("Your file was not the proper dimensions");
     } ELSE
     {
          echo "Your file has been uploaded.";
          // Insert your query here to update database information
     }
}
Hope that helps a little bit.

But, I think you should note that if you're looking for images that are 168x134 exactly, you're going to get a bunch of rejections. Not many images uploadoad directory and move file to designated path

$upload_dir = "path/to/dir";
if(is_uploaded_file($_FILES['filetoupload']['tmp_name']))
{
$time = time(); // for the purpose of a random filename
$filename2 = $_FILES['filetoupload']['name'];
$extension = strtolower(strrchr($filename2,"."));
$extensions = array('.ext','.ext','.ext'); // edit to your liking
if(!in_array($extension, $extensions))
{
die(&quote;File type not allowed.&quote;);
}
$filename = $time.$ext;
move_uploaded_file($_FILESї'filetoupload']ї'tmp_name'],$upload_dir.$filename)

// Check image size
$size = getimagesize(&quote;/home/username/public_html/path/to/dir/$filename&quote;);
$width = $sizeї0];
$height = $sizeї1];

if(($width &gt;= 180) || ($height &gt;= 180) // just an example, change to your liking
{
unlink(&quote;/home/username/public_html/path/to/dir/$filename&quote;);
die(&quote;Your file was not the proper diis.

Code: Select all

// Set upload directory and move file to designated path

$upload_dir = "path/to/dir";
if(is_uploaded_file($_FILES['filetoupload']['tmp_name']))
{
       $time = time(); // for the purpose of a random filename
	$filename2 = $_FILES['filetoupload']['name'];
	$extension = strtolower(strrchr($filename2,"."));
	$extensions = array('.ext','.ext','.ext'); // edit to your liking
	if(!in_array($extension, $extensions))
	{
		die("File type not allowed.");
	}
	$filename = $time.$ext; 
	move_uploaded_file($_FILES['filetoupload']['tmp_name'],$upload_dir.$filename)

     // Check image size
     $size = getimagesize("/home/username/public_html/path/to/dir/$filename");
     $width = $size[0];
     $height = $size[1];

     if(($width >= 180) || ($height >= 180)  // just an example, change to your liking
     {
          unlink("/home/username/public_html/path/to/dir/$filename");
          die("Your file was not the proper dimensions");
     } ELSE
     {
          echo "Your file has been uploaded.";
          // Insert your query here to update database information
     }
}
Hope that helps a little bit.

But, I think you should note that if you're looking for images that are 168x134 exactly, you're going to get a bunch of rejections. Not many images uploaded will be exactly that size.
$extensions = array('.ext','.ext','.ext'); // edit to your liking
if(!in_array($extension, $extensions))
{
die("File type not allowed.");
}
$filename = $time.$ext;
move_uploaded_file($_FILESї'filetoupload']ї'tmp_name'],$upload_dir.$filename)

// Check image size
$size = getimagesize(&quote;/home/username/public_html/path/to/dir/$filename&quote;);
$width = $sizeї0];
$height = $sizeї1];

if(($width &gt;= 180) || ($height &gt;= 180) // just an example, change to your liking
{
unlink(&quote;/home/username/public_html/path/to/dir/$filename&quote;);
die(&quote;;
if(is_uploaded_file($_FILES['filetoupload']['tmp_name']))
{
$time = time(); // for the purpose of a random filename
$filename2 = $_FILESї'filetoupload']ї'name'];
$extension = strtolower(strrchr($filename2,&quote;.&quote;));
$extensions = array('.ext','.ext','.ext'); // edit to your liking
if(!in_array($extension, $extensions))
{
die(&quote;File type not allowed.&quote;);
}
$filename = $time.$ext;
move_uploaded_file($_FILESї'filetoupload']ї'tmp_name'],$upload_dir.$filename)

// Check image size
$size = getimagesize(&quote;/home/username/public_html/path/to/dir/$filename&quote;);
$width = $sizeї0];
$height = $sizeї1];

if(($width &gt;= 180) || ($height &gt;= 180) // just an example, change to your liking
{
unlink(&quote;/home/username/public_html/path/to/dir/$filename&quote;);
die(&quote;Your file was not the proper dimensions&quote;);
} ELSE
{
echo &quote;Your file has been uploaded.&quote;;
// Insert your query here to update database information
}
}

Hope that helps a little bit.

Butth

$upload_dir = "path/to/dir";
if(is_uploaded_file($_FILES['filetoupload']['tmp_name']))
{
$time = time(); // for the purpose of a random filename
$filename2 = $_FILES['filetoupload']['name'];
$extension = strtolower(strrchr($filename2,"."));
$extensions = array('.ext','.ext','.ext'); // edit to your liking
if(!in_array($extension, $extensions))
{
die("File type not allowed.");
}
$filename = $time.$ext;
move_uploaded_file($_FILES['filetoupload']['tmp_name'],$upload_dir.$filename)

// Check image size
$size = getimagesize("/home/username/public_html/path/to/dir/$filename");
$width = $size[0];
$height = $size[1];

if(($width >= 180) || ($height >= 180) // just an example, change to your liking
{
unlink("/home/username/public_html/path/to/dir/$filename");
die("Your file was not the proper dimensions");
} ELSE
{
echo "Your file has been uploaded

Code: Select all

// Set upload directory and move file to designated path

$upload_dir = "path/to/dir";
if(is_uploaded_file($_FILES['filetoupload']['tmp_name']))
{
       $time = time(); // for the purpose of a random filename
	$filename2 = $_FILES['filetoupload']['name'];
	$extension = strtolower(strrchr($filename2,"."));
	$extensions = array('.ext','.ext','.ext'); // edit to your liking
	if(!in_array($extension, $extensions))
	{
		die("File type not allowed.");
	}
	$filename = $time.$ext; 
	move_uploaded_file($_FILES['filetoupload']['tmp_name'],$upload_dir.$filename)

     // Check image size
     $size = getimagesize("/home/username/public_html/path/to/dir/$filename");
     $width = $size[0];
     $height = $size[1];

     if(($width >= 180) || ($height >= 180)  // just an example, change to y;;
if(is_uploaded_file($_FILES['filetoupload']['tmp_name']))
{
       $time = time(); // for the purpose of a random filename
	$filename2 = $_FILES['filetoupload']['name'];
	$extension = strtolower(strrchr($filename2,"."));
	$extensions = array('.ext','.ext','.ext'); // edit to your liking
	if(!in_array($extension, $extensions))
	{
		die("File type not allowed.");
	}
	$filename = $time.$ext; 
	move_uploaded_file($_FILES['filetoupload']['tmp_name'],$upload_dir.$filename)

     // Check image size
     $size = getimagesize("/home/username/public_html/path/to/dir/$filename");
     $width = $size[0];
     $height = $size[1];

     if(($width >= 180) || ($height >= 180)  // just an example, change to your liking
     {
          unlink("/home/username/public_html/path/to/dir/$filename");
          die("Your file was not the proper dimensions");
     } ELSE
     {
          echo "Your file has been uploaded.";
          // Insert your query here to update database information
     }
}
Hope that helps a d move file to designated path

$upload_dir = "path/to/dir";
if(is_uploaded_file($_FILES['filetoupload']['tmp_name']))
{
$time = time(); // for the purpose of a random filename
$filename2 = $_FILES['filetoupload']ї'name'];
$extension = strtolower(strrchr($filename2,"."));
$extensions = array('.ext','.ext','.ext'); // edit to your liking
if(!in_array($extension, $extensions))
{
die("File type not allowed.");
}
$filename = $time.$ext;
move_uploaded_file($_FILES['filetoupload']['tmp_name'],$upload_dir.$filename)

// Check image size
$size = getimagesize("/home/username/public_html/path/to/dir/$filename");
$width = $size[0];
$height = $size[1];

if(($width >= 180) || ($height >= 180) // just an example, change to your liking
{
unlink("/home/username/public_html/path/to/dir/$filename");
die("Your file was not the proper dimensions");
} ELSE
{
echo "Your file has been uploaded.";
// Insert your query here to update database information
}
}

Hope that helps a little bit.

But, I think you should note that if you're looking for images that are 168x134 exactly, you're going to get a bunch of rejections. Not many images uploaded will be exactly that size.amp;quote;));
$extensions = array('.ext','.ext','.ext'); // edit to your liking
if(!in_array($extension, $extensions))
{
die("File type not allowed.");
}
$filename = $time.$ext;
move_uploaded_file($_FILES['filetoupload']['tmp_name'],$upload_dir.$filename)

// Check image size
$size = getimagesize("/home/username/public_html/path/to/dir/$filename");
$width = $size[0];
$height = $size[1];

if(($width >= 180) || ($height >= 180) // just an example, change to your liking
{
unxtension = strtolower(strrchr($filename2,"."));
$extensions = array('.ext','.ext','.ext'); // edit to your liking
if(!in_array($extension, $extensions))
{
die(&quote;File type not allowed.&quote;);
}
$filename = $time.$ext;
move_uploaded_file($_FILESї'filetoupload']ї'tmp_name'],$upload_dir.$filename)

// Check image size
$size = getimagesize(&quote;/home/username/public_html/path/to/dir/$filename&quote;);
$width = $sizeї0];
$height = $sizeї1];

if(($width &gt;= 180) || ($height &gt;= 180) // just an example, change to your liking
{
unlink(&quote;/home/username/public_html/path/to/dir/$filename&quote;);
die(&quote;Your file was not the proper dimensions&quote;);
} ELSE
{
ir = "path/to/dir";
if(is_uploaded_file($_FILES['filetoupload']['tmp_name']))
{
$time = time(); // for the purpose of a random filename
$filename2 = $_FILES['filetoupload']['name'];
$extension = strtolower(strrchr($filename2,"."));
$extensions = array('.ext','.ext','.ext'); // edit to your liking
if(!in_array($extension, $extensions))
{
die("File type not allowed.");
}
$filename = $time.$ext;
move_uploaded_file($_FILES['filetoupload']['tmp_name'],$upload_dir.$filename)

// Check image size
$size = getimagesize("/home/username/public_html/path/to/dir/$filename");
$width = $sizeї0];
$height = $sizeї1];

if(($f(is_uploaded_file($_FILES['filetoupload']['tmp_name']))
{
$time = time(); // for the purpose of a random filename
$filename2 = $_FILESї'filetoupload']ї'name'];
$extension = strtolower(strrchr($filename2,&quote;.&quote;));
$extensions = array('.ext','.ext','.ext'); // edit to your liking
if(!in_array($extension, $extensions))
{
die(&quote;File type not allowed.&quote;);
}
$filename = $time.$ext;
move_uploaded_file($_FILESї'filetoupload']ї'tmp_name'],$upload_dir.$filename)

// Check image size
$size = getimagesize(&quote;/home/username/public_html/path/to/dir/$filename&quote;);
$width = $sizeї0];
$height = $sizeї1];

if(($width &gt;= 180) || ($height &gt;= 180) // just an example, change to your liking
{
unlink(&quote;/home/username/public_html/path/to/dir/$filename");
die("Your file was not the proper dimensions");
} ELSE
{
echo &quile to designated path

$upload_dir = "path/to/dir";
if(is_uploaded_file($_FILES['filetoupload']['tmp_name']))
{
$time = time(); // for the purpose of a random filename
$filename2 = $_FILESї'filetoupload']ї'name'];
$extension = strtolower(strrchr($filename2,&quote;.&quote;));
$extensions = array('.ext','.ext','.ext'); // edit to your liking
if(!in_array($extension, $extensions))
{
die(&quote;File type not allowed.&quote;);
}
$filename = $time.$ext;
move_uploaded_file($_FILESї'filetoupload']ї'tmp_name'],$upload_dir.$filename)

// Check image size
$size = getimagesize(&quote;/home/username/public_html/path/to/dir/$filename&quote;);
$width = $sizeї0];
$height = $sizeї1];

if(($width &gt;= 180) || ($height &gt;= 180) // just an example, change to your liking
{
unlink(&quote;/home/username/public_html/path/to/dir/$filename&quote;);
die(&quote;Your file was not the proper dimensions&quote;);
} ELSE
{
echo &quote;Your file has been uploaded.&quote;;
// Insert your query here to update database information
}
}

Hope that helps a little bit.

But, I think you should note that if you're looking for images that path

$upload_dir = "path/to/dir";
if(is_uploaded_file($_FILES['filetoupload']['tmp_name']))
{
$time = time(); // for the purpose of a random filename
$filename2 = $_FILES['filetoupload']['name'];
$extension = strtolower(strrchr($filename2,"."));
$extensions = array('.ext','.ext','.ext'); // edit to your liking
if(!in_array($extension, $extensions))
{
die("File type not allowed.");
}
$filename = $time.$ext;
move_uploaded_file($_FILESї'filetoupload']ї'tmp_name'],$upload_dir.$filename)

// Check image size
$size = getimagesize(&quote;/home/username/public_html/path/to/dir/$filename&quote;);
$width = $sizeї0];
$height = $sizeї1];

if(($width &gt;= 180) || ($height &gt;= 180) // just an example, change to your liking
{
uupload directory and move file to designated path

$upload_dir = "path/to/dir";
if(is_uploaded_file($_FILES['filetoupload']['tmp_name']))
{
$time = time(); // for the purpose of a random filename
$filename2 = $_FILES['filetoupload']['name'];
$extension = strtolower(strrchr($filename2,"."));
$extensions = array('.ext','.ext','.ext'); // edit to your liking
if(!in_array($extension, $extensions))
{
die(&quote;File type not allowed.&quote;);
}
$filename = $time.$ext;
move_uploaded_file($_FILESї'filetoupload']ї'tmp_name'],$upload_dir.$filename)

// Check image size
$size = getimagesize(&quote;/home/username/public_html/path/to/dir/$filename&quote;);
$width = $sizeї0];
$height = $sizeї1];

if(($width &gt;= 180) || ($height &gt;= 180) // just an example, change to your liking
{
unlink(&quote;/home/username/public_html/path/to/dir/$filename&quote;);
die(&quote;Your file was not the proper dimensions&d912a2]

// Set upload directory and move file to designated path

$upload_dir = &quote;path/to/dir&quote;;
if(is_uploaded_file($_FILESї'filetoupload']['tmp_name']))
{
$time = time(); // for the purpose of a random filename
$filename2 = $_FILESї'filetoupload']ї'name'];
$extension = strtolower(strrchr($filename2,&quote;.&quote;));
$extensions = array('.ext','.ext','.ext'); // edit to your liking
if(!in_array($extension, $extensions))
{
die(&quote;File type not allowed.&quote;);
}
$filename = $time.$ext;
move_uploaded_file($_FILESї'filetoupload']ї'tmp_name'],$upload_dir.$filename)

// Check image size
$size = getimagesize(&quote;/home/username/public_html/path/to/dir/$filename&quote;);
$width = $sizeї0];
$height = $sizeї1];

if(($width &gt;= 180) || ($height &gt;= 180) // just an example, change to your liking
{
unlink(&quote;/home/username/public_html/path/to/dir/$filename&quote;);
die(&quote;Your file was not the proper dimensions&quote;);
} ELSE
{
echo &quote;Your file has been uploaded.&quote;;
// Insert your query here to update database information
}
}[/php:1:file to designated path

$upload_dir = "path/to/dir";
if(is_uploaded_file($_FILES['filetoupload']['tmp_name']))
{
$time = time(); // for the purpose of a random filename
$filename2 = $_FILES['filetoupload']['name'];
$extension = strtolower(strrchr($filename2,"."));
$extensions = array('.ext','.ext','.ext'); // edit to your liking
if(!in_array($extension, $extensions))
{
die("File type not allowed.&quote;);
}
$filename = $time.$ext;
move_uploaded_file($_FILES['filetoupload']['tmp_name'],$upload_dir.$filename)

// Check image size
$size = getimagesize(&quote;/home/username/public_html/path/to/dir/$filename&quote;);
$width = $sizeї0];
$height = $sizeї1];

if(($width &gt;= 180) || ($height &gt;= 180) // just an example, change to your liking
{
unlink(&quloaded_file($_FILES['filetoupload']['tmp_name']))
{
$time = time(); // for the purpose of a random filename
$filename2 = $_FILES['filetoupload']['name'];
$extension = strtolower(strrchr($filename2,"."));
$extensions = array('.ext','.ext','.ext'); // edit to your liking
if(!in_array($extension, $extensions))
{
die(&quote;File type not allowed.&quote;);
}
$filename = $time.$ext;
move_uploaded_file($_FILESї'filetoupload']ї'tmp_name'],$upload_dir.$filename)

// Check image size
$size = getimagesize(&quote;/home/username/public_html/path/to/dir/$filename&quote;);
$width = $sizeї0];
$height = $sizeї1];

if(($width &
iamkoa
Forum Newbie
Posts: 11
Joined: Sun Feb 06, 2005 11:36 pm

Post by iamkoa »

scrotaye thank you so much for your help!

I'm going to try what you wrote... I'll back here if everything works / doesn't work.

Thank again!
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

err I just noticed

line 22 should have an extra ')' at the end.
Post Reply