[PHP] Displaying Images

Joined
Apr 6, 2008
Messages
575
Reaction score
193
On my website I am using a database to hold figure-data like PHPRetro but I host my forums on a different dedicated server. So I am coding a file on my hotel’s server called “image.php” to display the images on my forum.
So far I have

Code:
$page['allow_guests'] = true;
require_once('./includes/core.php');
require_once('./includes/session.php');

$variablename = $_GET["i"];
$result = mysql_query("SELECT * FROM users WHERE name='$variablename'");
while($row = mysql_fetch_array($result))
  {
   $example = $row["figure"];
  }
//$page['id'] = "credits";
//$page['name'] = $lang->loc['pagename.credits'];
//$page['bodyid'] = "home";
//$page['cat'] = "credits";
//require_once('./templates/community_header.php');
?>
<img src="http://www.habbo.co.uk/habbo-imaging/avatarimage?figure=<?php echo $example; ?>&size=b&direction=3&head_direction=3&crr=0&gesture=sml&frame=1" width="64" height="110" />

This works fine and the varibels are all working but I wan't it to work like this.
Code:
[/SIZE][SIZE=2]
[/SIZE]
[SIZE=2]<html>
<img src="[URL="http://forum.ragezone.com/view-source:http://myosel.ath.cx/image.php?i=shop"]http://myosel.ath.cx/image.php?i=shop[/URL]">

But this for some reasson won't work. How can I make it work like this? Will I have to use the GD_Image?
If you can help thanks.
 
Last edited:
you can solve this by using headers in your php file:
PHP:
header('Content-Type: image/jpeg');
readfile('http://www.habbo.co.uk/habbo-imaging/avatarimage?figure='.$example.'&size=b&direction=3&head_direction=3&crr=0&gesture=sml&frame=1');

this will make your php file a dynamic image, which allows you to use it like <img src=="myphp.php" />
 
you can solve this by using headers in your php file:
PHP:
header('Content-Type: image/jpeg');
readfile('http://www.habbo.co.uk/habbo-imaging/avatarimage?figure='.$example.'&size=b&direction=3&head_direction=3&crr=0&gesture=sml&frame=1');
this will make your php file a dynamic image, which allows you to use it like <img src=="myphp.php" />

Thanks so much! The funny thing about this is when I woke up and had a wee I thought about using that :P
 
Last edited:
Back