Moh
02-01-2008, 05:55 PM
Well im trying to make this script select the habbo name from a users database, and then display it from just entering the username.
I have tried it without the database and it works.
<?php
header("Content-type: image/gif");
include("config.php");
$getuser = mysql_query("SELECT * from users where username = '$_GET[user]' AND banned = '0'");
$usernum = mysql_num_rows($getuser);
$profile = mysql_fetch_array($getuser);
$habbo = '$profile[habboname]';
$domain = 'http://www.habbo.$profile[hotel]';
$content = file_get_contents($domain . '/home/'.$habbo);
$div_start = explode('<div class="profile-figure">', $content, 2);
$div_end = explode('</div>', $div_start[1], 2);
$img = trim($div_end[0]);
$img = preg_replace('/<img alt=\"(.*?)\" src=\"(.*?)\" \/>/', '$2', $img);
$imag = $domain.$img;
$im = imagecreatefromgif($imag);
imagegif($im);
imagedestroy($im);
?>
Moved by Agesilaus (Forum Moderator) from Designing & Development: Please post in the correct forum next time. :)
I have tried it without the database and it works.
<?php
header("Content-type: image/gif");
include("config.php");
$getuser = mysql_query("SELECT * from users where username = '$_GET[user]' AND banned = '0'");
$usernum = mysql_num_rows($getuser);
$profile = mysql_fetch_array($getuser);
$habbo = '$profile[habboname]';
$domain = 'http://www.habbo.$profile[hotel]';
$content = file_get_contents($domain . '/home/'.$habbo);
$div_start = explode('<div class="profile-figure">', $content, 2);
$div_end = explode('</div>', $div_start[1], 2);
$img = trim($div_end[0]);
$img = preg_replace('/<img alt=\"(.*?)\" src=\"(.*?)\" \/>/', '$2', $img);
$imag = $domain.$img;
$im = imagecreatefromgif($imag);
imagegif($im);
imagedestroy($im);
?>
Moved by Agesilaus (Forum Moderator) from Designing & Development: Please post in the correct forum next time. :)