Jump to content

if file_exists problems


leslie_

Recommended Posts

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);
?>

Link to comment
https://forums.phpfreaks.com/topic/80839-if-file_exists-problems/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.