leslie_ Posted December 9, 2007 Share Posted December 9, 2007 Okay well i have a script that generates an image and it uses query strings depending on people preferences in their profile. With that being said, if someone has something incorrect in their profile or nothing at all the image just doesnt show so i put in a if file_exists thing, but now i just keep getting the exist image which displays "unknown" even if the info is correct. The querystring 'hotel' is either .com.au or .co.uk or .com.sg Can someone tell me whats wrong with this code???? it worked fine until i put in the file_exists thing. <?php header("Content-type: image/png"); include ('habboClass.php'); $habbo = $_GET['name']; $hotel = $_GET['hotel']; $url = "http://www.habbo".$hotel."/habbo-imaging/avatarimage?user=".$habbo."&action=&direction=2&head_direction=2&gesture=sml&size=l&img_format=gif"; //Data Retrieval $habboHome = new habboClass($habbo, $hotel); if (file_exists($url)) { $im = imagecreatefrompng("figure.png"); $habboFigure = $habboHome->figure(); $habboFigure = imagecreatefromgif($habboFigure); imagecopy($im, $habboFigure, 0, 0, 0, 0, 64, 106); } else { $im = imagecreatefrompng("exist.png"); } //Create Image imagepng($im); imagedestroy($im); ?> Quote Link to comment Share on other sites More sharing options...
scarlson Posted December 9, 2007 Share Posted December 9, 2007 From what I can see, (I am by no means good with PHP) your code looks fine for file_exits . Is the $url correct, if there is a single problem with that long link the file_exists will return false and not work. Quote Link to comment Share on other sites More sharing options...
leslie_ Posted December 9, 2007 Author Share Posted December 9, 2007 I'm positive the URL is correct 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.