guitar idiot Posted December 1, 2007 Share Posted December 1, 2007 Ok can someone give me an explanation on getimagesize()?? Heres what i need, I need to get an image from a file and shrink it down to a normal size, but not to make it disproportionate. (In the database, $pic is whether its gif or jpeg. <?phpsession_start();if(isset($_SESSION['username'])) {$username=$_SESSION['username'];$db_host = 'localhost'; $db_user = '*****'; $db_pass ='*****'; $db_db = 'user'; $uid = $_GET['uid']; $db_link = mysql_connect($db_host, $db_user, $db_pass) or die('MySQL Connection Error:' .mysql_error()); mysql_select_db($db_db) or die('Error');$query = mysql_query("SELECT * FROM fuser WHERE username = '$username'");$query_row=mysql_fetch_array($query);$id = ($query_row['id']);$pic = ($query_row['picture']);if ($id!=$uid) {echo 'This is not your account';} else {$query2 = mysql_query("SELECT username, password FROM fuser WHERE username = '$username'");$query_row2=mysql_fetch_array($query2);$user = ($query_row2['username']);if($user===$username) {mysql_close($db_link);?><html><head><link rel="stylesheet" type="text/css"href="main.css" /></head><body><div><h1>User Profile</h1></div><div class="info"><img src="upload/<?php echo $username . $pic; ?>" width/></div><div class="nav"><?php echo '<a href="uploading.php?id=' . $uid . '">Edit Profile</a><br /><a href="forum.php">Back to Forums</a><br /><a href="offense.php">View Offenses</a><br /> ' . $pic; ?></div><?php } } } else { echo 'You are not logged in'; } ?></body></html> Link to comment Share on other sites More sharing options...
justsomeguy Posted December 3, 2007 Share Posted December 3, 2007 I don't see where you're trying to check on an image but getimagesize only works on files. If you are trying to build your own image with an image object you can use imagesx and imagesy to get the dimension. If the image is a saved file then you can send the filename to getimagesize to get information about the file.http://www.php.net/manual/en/function.getimagesize.php Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.