Problem with Dynamic Pictures/Sites

Ok i made some Dynamic pictures in php5 and i wonder why they arent shown?

here this is what i mean:

not shown:
ichigokurosaki.bplaced.net/l … Duelz.png/

shown (should be like this…)
jayjsp.freehostia.com/ls/Bamf_Duelz.png/

thx for help

regards

Maybe you should provide us the script you are using or tell us how you tried to make those dynamic images…

Hi,

i think you should use mod rewrite for graphics, an not work with directorys,

And one scripts don´t work, for example ichigokurosaki.bplaced.net/ls/MtotheC.png/

I think the problem why this example doesn´t work is, that you use absolute paths, like …/custum/nameoffile instead of /custum/nameoffile

[quote=“kla_kal”]Hi,

i think you should use mod rewrite for graphics, an not work with directorys,

And one scripts don´t work, for example ichigokurosaki.bplaced.net/ls/MtotheC.png/

I think the problem why this example doesn´t work is, that you use absolute paths, like …/custum/nameoffile instead of /custum/nameoffile[/quote]

nope its all right… i think its just because i didnt used .htaccess in the folders

and now the site isnt available anymore… any idea how to fix?

I meant the link from me.

PS: my signature works with mod rewrite.

ichigokurosaki.bplaced.net/ls/Bamf_duelz.png

the site wont show up… it did when i added a file named “.htaccess” with only written “option multiviews” in it…

the next day it didnt show up and now it says it isnt available anymore… any idea why?

thx for helping

You must not use Options +FollowSymLinks in your .htaccess :wink:

could u send me the comlete code for the htaccess file?

€: sorry, understood you false…

well without htaccess like that i cant view the image… -.-’

so how can i solve it other way?

your .htaccess should look like this:

RewriteEngine On
RewriteRule image.png image.php

That will start “image.php” every time “image.png” is requested :wink:

Your Code should have the following lines:

and

more info here: php.net/gd

i did as u said but it doesnt work… maybe it would help if u know the code:

image.php (before this was index.php)

[code]<?php
Header(‘Content-type: image/png’);
Header(‘Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0’);
Header(‘Expires: Thu, 19 Nov 1981 08:52:00 GMT’);
Header(‘Pragma: no-cache’);

$expbar_width = 100;
$expbar_height = 15;

$image = imagecreatefrompng(‘Background2.png’);

$cool = imagecolorallocate($image, 81, 126, 255);
$schwarz = imagecolorallocate($image, 255, 255, 255);
$rot = imagecolorallocate($image, 0, 255, 0);

$font = ‘/avqest.ttf’;

//LS STUFF

$class_name = array( -1 => ‘None’,
0 => ‘Fighter’,
1 => ‘Barbarian’,
2 => ‘Rogue’,
3 => ‘Magician’,
4 => ‘Guardian’,
5 => ‘Samurai’,
6 => ‘Paladin’,
7 => ‘Monk’,
8 => ‘Ninja’,
9 => ‘Warlock’,
10 => ‘Headhunter’,
11=> ‘Alchemist’);
$core_name = array( 0 => ‘SC’, 1 => ‘HC’);

$data = simplexml_load_file(‘http://ladderslasher.d2jsp.org/xmlChar.php?i=180644’);
$name = $data->name;
$kills = number_format((int)$data->kills, 0, “”, “.”);
$class = $class_name[(int)$data->classid];
$classid = (int)$data->classid;
$core =$core_name[(int)$data->core];
$exp = $data->exp;
$level = $data->level;
$hpmax = number_format((int)$data->hpmax, 0, “”, “.”);
$mqpasses = $data->mqpasses;
$mqattempts = $data->mqattempts;
$exp = (int)$exp;
$percent = calcExpPercent($exp);
$brpixelX = calcBrPixelX($exp,$expbar_width);
$mqrate = calcMqPercent($mqpasses,$mqattempts);
$death = number_format((int)$data->deaths, 0, “”, “.”);
$str = $data->strength;
$dex = $data->dexterity;
$int = $data->intelligence;
$vit = $data->vitality;
$mpmax = number_format((int)$data->mpmax, 0, “”, “.”);

ImageTTFText ($image, 8, 0, 75, 71, $schwarz, $font, “Kills”);
ImageTTFText ($image, 8, 0, 75, 83, $schwarz, $font, “Deaths”);
ImageTTFText ($image, 8, 0, 75, 95, $schwarz, $font, “Life”);
ImageTTFText ($image, 8, 0, 75, 107, $schwarz, $font, “Mana”);
imagettftext ($image, 8, 0, 157, 71, $schwarz, $font, “Strength”);
ImageTTFText ($image, 8, 0, 157, 83, $schwarz, $font, “Dexterity”);
ImageTTFText ($image, 8, 0, 157, 95, $schwarz, $font, “Vitality”);
ImageTTFText ($image, 8, 0, 157, 107, $schwarz, $font, “Intelligence”);

ImageTTFText ($image, 15, 0, 125, 30, $schwarz, $font,$name);
ImageTTFText ($image, 8, 0, 112, 42, $schwarz, $font, “Level “.$level.” “.$core.” “.$class);
ImageTTFText ($image, 8, 0, 125, 54, $schwarz, $font, “MQ’s “.$mqpasses.”/”.$mqattempts.” (”.$mqrate."%)");

ImageTTFText ($image, 8, 0, 112, 71, $cool, $font, $kills);
ImageTTFText ($image, 8, 0, 112, 83, $cool, $font, $death);
ImageTTFText ($image, 8, 0, 112, 95, $cool, $font, $hpmax);
ImageTTFText ($image, 8, 0, 112, 107, $cool, $font, $mpmax);
ImageTTFText ($image, 8, 0, 222, 71, $rot, $font, $str);
ImageTTFText ($image, 8, 0, 222, 83, $rot, $font, $dex);
ImageTTFText ($image, 8, 0, 222, 95, $rot, $font, $int);
ImageTTFText ($image, 8, 0, 222, 107, $rot, $font, $vit);

imagefilledrectangle($image, 115, 108, 215, 115, $schwarz);
imagefilledrectangle($image, 115, 108, $brpixelX, 115, $rot);

ImageTTFText ($image, 7, 0, 125, 115, $cool, $font, $percent."% to Level done");

// output and destroy
imagepng($image_handle);
imagedestroy($image);

/******************************************************

  •                 FUNCTIONS                      *
    

******************************************************/

function calcBrPixelX($input,$xpbar_width)
{
$temp1 = fmod($input,1000000);
$temp1 = ($temp1/1000000);
$temp1 = $temp1 * $xpbar_width;
$temp1 = $temp1 + 115;

return (int)$temp1;

}

function calcExpPercent($input)
{
$temp1 = fmod($input,1000000);
$temp1 = ($temp1/1000000);
$temp1 = $temp1 * 100;

return (int)$temp1;

}

function calcMqPercent($y,$x)
{

$temp1 = ($y/$x);
$temp1 = $temp1 * 100;

return (int)$temp1;

}

?>[/code]

comment the Header(‘Content-type: image/png’);. If you request the image.php you should be able to read error-messages, if there isn’t a error message (only some ASCII-Chars), everything should be ok :wink:

ichigokurosaki.bplaced.net/ls/Ba … /image.php

could someone look over this? and tell me why the hell it cant open the XML?

I commented the header so dont wonder why ascii is given out…

It says: You can’t access a file, that is not on the lokal machine.
access to files on remote machines (via http:// etc) is disabled.

It says: You can’t access a file, that is not on the lokal machine.
access to files on remote machines (via http:// etc) is disabled.[/quote]

so its just imposible on this server to access XML files?

you can store your XML-File on your FTP-Directory, external access is currently impossible.