0

update_image2.php

$result2 = mysql_query("SELECT * FROM image_upload");

                $data2 = mysql_fetch_array($result2);

                if($image_width > $data2['maxwidth'] || $image_height > $data2['maxheight'])
                    {
                    echo '<br>'."Image is too big".'<br>';
                    echo $image_width.'>'.$data2['maxwidth_bn'].'<br>';
                    echo $image_height.'>'.$data2['maxheight_bn'];
                    exit();
                    }

Successfully upload pictures
Image is too big
995>1000
227>240

I wonder why the message says the image is too big?

2
Contributors
2
Replies
24
Views
2 Years
Discussion Span
Last Post by davy_yg
0

Your IF statement checks against maxwidth and maxheight but you output maxheight_bn and maxwidth_bn. How do you know they're the same?
As the code in the loop is firing either the width or the height is greater than maxwidth or maxheight.

0

I try this:

$image_info = getimagesize($_FILES["file"]["name"]);
                $image_width = $image_info[0];
                $image_height = $image_info[1];
                print_r("$image_width");

I am trying to see the result of $image_width, yet I do not see the result.

I wonder why?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.