compile .php to image?

nightscream

New Member
Messages
948
Reaction score
0
Points
0
I thought this was the best place for posting this
How can i convert a .php into a .png, .gif or something
Maybe some more info like i have in my php fuction to show viewer browser, windows version, etc
in a php file. And i wan't that exactly in a image extension
because not every forum allows the .php extension, i need this for avatar & sig. Tthat's why .png and such
 

Chris Z

Active Member
Messages
5,603
Reaction score
0
Points
36
i don't know the exact code for it, but i can create one for you for 750-1000 points, view my thread in the marketplace :D
 

nightscream

New Member
Messages
948
Reaction score
0
Points
0
that's not what i meant, your sig is .php and i need .png or something, just have to know how
 

Torch

New Member
Messages
634
Reaction score
0
Points
0
You can try my SigChat service :) ... http://sigchatservice.com, and it's free too.

Anyway, if you want your sig/avatar to be dynamic (like show IP of person who's looking at it), you have to make it php. But you can fool forum, by making a mod_rewrite alias address to your php file (eg. regular is www.mysite.com/sig.php and mod_rewrite url would be www.mysite.com/sig.png), and than using that alias url in sig/avatar.
Good site on mod_rewrite is www.modrewrite.com
 
Last edited:

dharmil

New Member
Messages
1,656
Reaction score
0
Points
0
well you can just change the header of it

PHP:
<?php
// GIF
 header('Content-type: image/gif');
// JPEG
header('image/pjpeg');
// PNG
header('Content-type: image/png');
// BMP
header('Content-type: image/bmp');
// JPEG
header('Content-type: image/jpeg');
?>
 

Torch

New Member
Messages
634
Reaction score
0
Points
0
dharmil said:
well you can just change the header of it

PHP:
<?php
// GIF
header('Content-type: image/gif');
// JPEG
header('image/pjpeg');
// PNG
header('Content-type: image/png');
// BMP
header('Content-type: image/bmp');
// JPEG
header('Content-type: image/jpeg');
?>
That goes without saying if you want to generate image directly from access to .php file...

Like I said, your best bet would be my suggestion from above or setting your server to parse eg. .png files as php (but than all your other .png images would be parsed as php instead of images).
 
Last edited:

cetutnx1

New Member
Messages
510
Reaction score
0
Points
0
maybe you can chage the extension that are exucuting php code, i didit in cpanel, that may work, but of course there is a problem, all the images that you have with this extensions are going to be opened by php...
if you are interested in this method i can tell you how i didit
 

Torch

New Member
Messages
634
Reaction score
0
Points
0
I just said that in my post above...

But it seems that that feature is disabled in the new cPanel we have now. Again, best thing would making mod_rewrite alias...
 

celebraces

Banned
Messages
12
Reaction score
0
Points
0
Put this in your .htaccess file

Code:
Options +FollowSymlinks
RewriteEngine on

RewriteRule ^avatar/image.png$ avatar/index.php

(i hope ;))

With apache, you use recursive directories. add "/image.png" to the end and make the forum *think* it's not dynamic. (I don't think this works with vBulletin)
 
Last edited:
Top