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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.