gerkintrigg Posted July 20, 2007 Share Posted July 20, 2007 I'm trying to work out how to re-size an image before it's downloaded. I've worked out how to force a download and hide the original file: <?php // start the session session_start(); $root='../'; header("Cache-control: private"); //IE 6 Fix include $root.'includes/db.php'; if ($_SESSION['Logged_In']=='Yes'){ //check the number of credits available: $points=mysql_fetch_array(mysql_query("SELECT Points FROM member WHERE userid=".$_SESSION['my_id'])); $points=$points['Points']; if ($points>=3){ header("Content-Type: image/jpg"); header("Content-Disposition: image; filename=image.jpg"); //includes/imgsize.php?w=400&h=400&constrain=1&img=http://www.nextdaygraphics.com/'.$item['watermarked_img'] readfile("../".$_SESSION['item_img_url']); mysql_query("UPDATE `member` SET `Points` = (`Points`-3) WHERE `userid` =".$_SESSION['my_id']." LIMIT 1 ;"); } else{ $go='http://www.nextdaygraphics.com/buy_credits.php'; header('Location:'.$go); } } else{ $go='http://www.nextdaygraphics.com/buy_credits.php'; header('Location:'.$go); } ?> I just have no idea how to resize it. I have a function that does it via the URL, but it's not working for this function (no errors displayed though). any ideas? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.