+ Reply to Thread
Results 1 to 10 of 10

Thread: compile .php to image?

  1. #1
    nightscream is offline x10 Lieutenant nightscream is an unknown quantity at this point
    Join Date
    Feb 2006
    Location
    Hallaar, Belgium
    Posts
    474

    compile .php to image?

    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
    ------------------------------------------------------------------------------------------
    If you have any troubles with a website or a script, just send me a pm.

    I also code websites in xHTML/css, can code javascript and php too if needed

  2. #2
    Chris Z's Avatar
    Chris Z is offline x10 Spammer Chris Z is an unknown quantity at this point
    Join Date
    Sep 2005
    Location
    Alabama, USA
    Posts
    2,802

    Re: compile .php to image?

    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
    -Chris Z
    Retired Account Manager


  3. #3
    nightscream is offline x10 Lieutenant nightscream is an unknown quantity at this point
    Join Date
    Feb 2006
    Location
    Hallaar, Belgium
    Posts
    474

    Re: compile .php to image?

    that's not what i meant, your sig is .php and i need .png or something, just have to know how
    ------------------------------------------------------------------------------------------
    If you have any troubles with a website or a script, just send me a pm.

    I also code websites in xHTML/css, can code javascript and php too if needed

  4. #4
    Torch's Avatar
    Torch is offline x10 Lieutenant Torch is an unknown quantity at this point
    Join Date
    Apr 2006
    Location
    Belgrade, Serbia
    Posts
    317

    Re: compile .php to image?

    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 by Torch; 07-14-2006 at 07:54 AM.

  5. #5
    dharmil's Avatar
    dharmil is offline x10 Elder dharmil is an unknown quantity at this point
    Join Date
    Sep 2005
    Location
    Avenel New Jersey
    Posts
    828

    Re: compile .php to image?

    well you can just change the header of it

    PHP Code:
    <?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');
    ?>

  6. #6
    Torch's Avatar
    Torch is offline x10 Lieutenant Torch is an unknown quantity at this point
    Join Date
    Apr 2006
    Location
    Belgrade, Serbia
    Posts
    317

    Re: compile .php to image?

    Quote Originally Posted by dharmil
    well you can just change the header of it

    PHP Code:
    <?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 by Torch; 07-14-2006 at 01:27 PM.

  7. #7
    cetutnx1's Avatar
    cetutnx1 is offline x10 Lieutenant cetutnx1 is an unknown quantity at this point
    Join Date
    Nov 2005
    Location
    Córdoba, Argentina
    Posts
    255

    Re: compile .php to image?

    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

  8. #8
    Torch's Avatar
    Torch is offline x10 Lieutenant Torch is an unknown quantity at this point
    Join Date
    Apr 2006
    Location
    Belgrade, Serbia
    Posts
    317

    Re: compile .php to image?

    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...

  9. #9
    nightscream is offline x10 Lieutenant nightscream is an unknown quantity at this point
    Join Date
    Feb 2006
    Location
    Hallaar, Belgium
    Posts
    474

    Re: compile .php to image?

    ok thx i'll give it a shot
    ------------------------------------------------------------------------------------------
    If you have any troubles with a website or a script, just send me a pm.

    I also code websites in xHTML/css, can code javascript and php too if needed

  10. #10
    celebraces is offline Banned celebraces is an unknown quantity at this point
    Join Date
    May 2006
    Posts
    6

    Re: compile .php to image?

    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 by celebraces; 08-02-2006 at 04:03 AM.

+ Reply to Thread

Similar Threads

  1. Need Image cut 35 Points!
    By Fire Wolf in forum The Marketplace
    Replies: 3
    Last Post: 05-03-2006, 03:21 AM
  2. errors while attaching
    By mattspec in forum Feedback and Suggestions
    Replies: 0
    Last Post: 12-19-2005, 01:50 PM
  3. November Desktop
    By n4tec in forum Off Topic
    Replies: 12
    Last Post: 11-08-2005, 07:18 AM
  4. Photoshop Tutorials
    By Cambridge in forum Tutorials
    Replies: 9
    Last Post: 10-02-2005, 09:16 AM
  5. Add free image hosting to your site
    By nigelwong in forum Off Topic
    Replies: 2
    Last Post: 09-19-2005, 04:57 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers