Home Forums Register FAQ Members List Calendar Search Today's Posts Mark Forums Read Arcade Chat
Go Back   ClubPenguinHQ Forums > General Discussion > Programming > PHP
Reload this Page PHP Images?
PHP Discussion of PHP scripts belongs here.

PHP Images?

Reply
 
LinkBack Thread Tools Display Modes
PHP Images?
Old
  (#1)
Plonk is Offline
Super Member
Plonk is an unknown quantity at this point
 
Plonk's Avatar
 
Posts: 2,458
Join Date: Apr 2008
Location: #iamthewalrus
Rep Power: 0
  Send a message via AIM to Plonk  
Default PHP Images? - Monday, September 1st, 2008

How do you make php files be the image source? Like, in this example:
Code:
[img]file.php[/img]
I've seen it before, and I just want to know how you can make PHP into a dynamic image file.
Thanks!

Oh, and first post in the new forums.

~Plonk.


I have left CPHQ forever.

I will VERY occaisionally be on #iamthewalrus. Don't count on it.
  
Reply With Quote
Re: PHP Images?
Old
  (#2)
Medo0 is Offline
Member
Medo0 is an unknown quantity at this point
 
Posts: 413
Join Date: May 2008
Location: Palestine
Age: 13
Rep Power: 0
  Send a message via MSN to Medo0  
Default Re: PHP Images? - Monday, September 1st, 2008

Where do I put The Image Path OR Link???
in image.php?
  
Reply With Quote
Re: PHP Images?
Old
  (#3)
Plonk is Offline
Super Member
Plonk is an unknown quantity at this point
 
Plonk's Avatar
 
Posts: 2,458
Join Date: Apr 2008
Location: #iamthewalrus
Rep Power: 0
  Send a message via AIM to Plonk  
Default Re: PHP Images? - Monday, September 1st, 2008

I don't know, I was wondering how to do that.

And welcome back from your ban, Medo0!


I have left CPHQ forever.

I will VERY occaisionally be on #iamthewalrus. Don't count on it.
  
Reply With Quote
Re: PHP Images?
Old
  (#4)
Medo0 is Offline
Member
Medo0 is an unknown quantity at this point
 
Posts: 413
Join Date: May 2008
Location: Palestine
Age: 13
Rep Power: 0
  Send a message via MSN to Medo0  
Default Re: PHP Images? - Monday, September 1st, 2008

Thanks Dude
  
Reply With Quote
Re: PHP Images?
Old
  (#5)
PenXZ is Offline
Super Member
PenXZ is an unknown quantity at this point
 
PenXZ's Avatar
 
Posts: 1,016
Join Date: Aug 2007
Location: Italy
Age: 14
Rep Power: 0
  Send a message via MSN to PenXZ  
Default Re: PHP Images? - Monday, September 1st, 2008

OK. If you want to output an image in PHP you have to use imagecreatefrompng(), imagestring(), imagepng(), imagedestroy() and bla bla bla.

First, you upload a background picture and name it example background.png.
[code=PHP:hjtjx0ks]<span class="syntaxhtml">
<span class="syntaxdefault"><?php
headerÂ*</span><span class="syntaxkeyword">(</span><span class="syntaxstring">"Content-type:Â*image/png"</span><span class="syntaxkeyword">);
</span><span class="syntaxdefault">$imÂ*</span><span class="syntaxkeyword">=Â*</span><span class="syntaxdefault">imagecreatefrompng</span><span class="syntaxkeyword">(</span><span class="syntaxstring">"background.png"</span><span class="syntaxkeyword">);
</span><span class="syntaxdefault">$whiteÂ*</span><span class="syntaxkeyword">=Â*</span><span class="syntaxdefault">imagecolorallocate</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$im</span><span class="syntaxkeyword">,Â*</span><span class="syntaxdefault">255</span><span class="syntaxkeyword">,Â*</span><span class="syntaxdefault">255</span><span class="syntaxkeyword">,Â*</span><span class="syntaxdefault">255</span><span class="syntaxkeyword">);
</span><span class="syntaxdefault">imagestring</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$im</span><span class="syntaxkeyword">,Â*</span><span class="syntaxdefault">3</span><span class="syntaxkeyword">,Â*</span><span class="syntaxdefault">5</span><span class="syntaxkeyword">,Â*</span><span class="syntaxdefault">5</span><span class="syntaxkeyword">,Â*Â*</span><span class="syntaxstring">"YourÂ*IPÂ*is:Â*"</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">$_SERVER</span><span class="syntaxkeyword">[</span><span class="syntaxstring">"REMOTE_ADDR"</span><span class="syntaxkeyword">],Â*</span><span class="syntaxdefault">$white</span><span class="syntaxkeyword">);
</span><span class="syntaxdefault">imagepng</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$im</span><span class="syntaxkeyword">);
</span><span class="syntaxdefault">imagedestroy</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$im</span><span class="syntaxkeyword">);
</span><span class="syntaxdefault">?>
</span></span>[/code:hjtjx0ks]
This will create an image that shows your current IP.
If you want to use this on forums, you have to use:
Code:
[IMG]IMAGE URL GOES HERE[/IMG]
If you hate the .php extension, you can play a bit with htaccess (I don't know if renaming the file works), but it's pretty hard.


Same siggy, same skills, same person.

PenXZ, a name, a user and the warranty I don't care about you.

~Ex Cheating God and Art Master~
  
Reply With Quote
Re: PHP Images?
Old
  (#6)
Plonk is Offline
Super Member
Plonk is an unknown quantity at this point
 
Plonk's Avatar
 
Posts: 2,458
Join Date: Apr 2008
Location: #iamthewalrus
Rep Power: 0
  Send a message via AIM to Plonk  
Default Re: PHP Images? - Monday, September 1st, 2008

Thanks, PenXZ, that's exactly what I needed!


I have left CPHQ forever.

I will VERY occaisionally be on #iamthewalrus. Don't count on it.
  
Reply With Quote
Re: PHP Images?
Old
  (#7)
PenXZ is Offline
Super Member
PenXZ is an unknown quantity at this point
 
PenXZ's Avatar
 
Posts: 1,016
Join Date: Aug 2007
Location: Italy
Age: 14
Rep Power: 0
  Send a message via MSN to PenXZ  
Default Re: PHP Images? - Monday, September 1st, 2008

Quote:
Originally Posted by Plonk
Thanks, PenXZ, that's exactly what I needed!
Problem solved then .


Same siggy, same skills, same person.

PenXZ, a name, a user and the warranty I don't care about you.

~Ex Cheating God and Art Master~
  
Reply With Quote
Re: PHP Images?
Old
  (#8)
Devo12345 is Offline
Member
Devo12345 is an unknown quantity at this point
 
Posts: 315
Join Date: Nov 2007
Age: 16
Rep Power: 0
   
Default Re: PHP Images? - Monday, September 1st, 2008

Wow thanks penxz
  
Reply With Quote
Re: PHP Images?
Old
  (#9)
Flareon 95 is Offline
New Member
Flareon 95 is an unknown quantity at this point
 
Posts: 9
Join Date: Aug 2008
Rep Power: 0
  Send a message via MSN to Flareon 95  
Default Re: PHP Images? - Monday, September 1st, 2008

Thanks for the PHP Image thing. Now I have more Ideas in mind. It helped a lot. ;)
  
Reply With Quote
Re: PHP Images?
Old
  (#10)
Bollivierke is Offline
Über Member
Bollivierke is on a distinguished road
 
Bollivierke's Avatar
 
Posts: 4,036
Join Date: Jul 2007
Location: Belgium
Age: 15
Rep Power: 35
  Send a message via AIM to Bollivierke Send a message via MSN to Bollivierke  
Default Re: PHP Images? - Monday, September 1st, 2008

Quote:
Originally Posted by PenXZ
OK. If you want to output an image in PHP you have to use imagecreatefrompng(), imagestring(), imagepng(), imagedestroy() and bla bla bla.

First, you upload a background picture and name it example background.png.
[code=PHP:2lai5jfh]<span class="syntaxhtml">
<span class="syntaxdefault"><?php
headerÂ*</span><span class="syntaxkeyword">(</span><span class="syntaxstring">"Content-type:Â*image/png"</span><span class="syntaxkeyword">);
</span><span class="syntaxdefault">$imÂ*</span><span class="syntaxkeyword">=</span><span class="syntaxdefault">Â*imagecreatefrompng</span><span class="syntaxkeyword">(</span><span class="syntaxstring">"background.png"</span><span class="syntaxkeyword">);
</span><span class="syntaxdefault">$whiteÂ*</span><span class="syntaxkeyword">=</span><span class="syntaxdefault">Â*imagecolorallocate</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$im</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">Â*255</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">Â*255</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">Â*255</span><span class="syntaxkeyword">);
</span><span class="syntaxdefault">imagestring</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$im</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">Â*3</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">Â*5</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">Â*5</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">Â*Â*</span><span class="syntaxstring">"YourÂ*IPÂ*is:Â*"</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">$_SERVER</span><span class="syntaxkeyword">[</span><span class="syntaxstring">"REMOTE_ADDR"</span><span class="syntaxkeyword">],</span><span class="syntaxdefault">Â*$white</span><span class="syntaxkeyword">);
</span><span class="syntaxdefault">imagepng</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$im</span><span class="syntaxkeyword">);
</span><span class="syntaxdefault">imagedestroy</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$im</span><span class="syntaxkeyword">);
</span><span class="syntaxdefault">?>
</span></span>[/code:2lai5jfh]
This will create an image that shows your current IP.
If you want to use this on forums, you have to use:
Code:
[IMG]IMAGE URL GOES HERE[/IMG]
If you hate the .php extension, you can play a bit with htaccess (I don't know if renaming the file works), but it's pretty hard.
What page is that PHP code for?




Bored.
Send me a PM for a Lockerz.com invite!
  
Reply With Quote
Reply

Lower Navigation
Go Back   ClubPenguinHQ Forums > General Discussion > Programming > PHP

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0
vBulletin Skin developed by: vBStyles.com
Copyright ©2006 - 2009, RancidKraut Industries