Jump to content

Defining the Image size for browser?


al3x8730

Recommended Posts

I'm using an auto generated image using: And when I try to attach an image like that to a forum signature it says that it can't determine the size of the image thus it can not add it to the signature. How would I make it define it for the browser?

 

<?php
error_reporting(E_ALL);
include "header.php";

$nameSearch = mysql_real_escape_string($_REQUEST['name']);
$sql = "SELECT * FROM users WHERE Name='{$nameSearch}'";
$result = mysql_query($sql) or die(mysql_error());
$row = mysql_fetch_assoc($result);
$id = $row['ID'];
$name = $row['Name'];
$title = $row['Title'];
$level = $row['Level'];
$experience = $row['Experience'];
$gender = $row['Gender'];

$tnl = floor((133.1*pow($level+1,3))-$experience);


$info = $name.' '.$title.' '.$experience.' '.$gender.' '.$tnl;



$im = imagecreate(250, 30);


$bg = imagecolorallocate($im, 0, 0, 0);
$textcolor = imagecolorallocate($im, 0, 0, 255);

// Write the string at the top left
imagestring($im, 5, 8, 5, $info, $textcolor);


// Output the image
header('Content-type: image/png');

imagepng($im);
imagedestroy($im);
?>

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/124416-defining-the-image-size-for-browser/
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.