Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Making A Sig With Php, just wondering how it works
elrohir
post Oct 5 2006, 06:16 PM
Post #1


Premium Member
********

Group: Members
Posts: 165
Joined: 17-May 06
Member No.: 23,815



I was just wondering how to make an image that uses stuff given to it by php, yet remains only an image - say I want the site's title in an image.

I believe it has something to do with putting an index.php inside a folder called image.png or whatever. Am I right?

thanks
Go to the top of the page
 
+Quote Post
rvalkass
post Oct 5 2006, 07:04 PM
Post #2


apt-get moo
Group Icon

Group: [MODERATOR]
Posts: 2,153
Joined: 28-May 05
From: Devon, England
Member No.: 7,593
Spam Patrol



This depends. PHP can generate any image it likes on the fly and create a PNG, GIF or JPG file. The reason a folder called something.png is required is becuase forums do not allow you to put PHP files as an image in your sig, so they can be made to believe that the folder is actually an image and they still see the output of index.php within that folder. Try looking in the tutorials sections here at Trap17, especially the graphics section, and you will see many tutorials on making PHP signatures.
Go to the top of the page
 
+Quote Post
Spectre
post Oct 6 2006, 04:34 AM
Post #3


Privileged Member
*********

Group: Members
Posts: 873
Joined: 30-July 04
Member No.: 246



You can link to a PHP file as an image (eg. site.com/image.php), and the browser will treat it as an image provided the script sends it the correct header specifying the type of file it is - such as header('Content-Type: image/gif'). If your host supports it - which I belive Trap17 does, although I may be wrong (I don't have hosting here) - you can force a certain file to be treated as an image by way of a .htaccess file:

CODE
<Files image.gif>
ForceType application/x-httpd-php
</Files>


Thus, the file image.gif is in actual fact a PHP script, even though it has a .gif extension. Placing the index.php script in a folder called 'image.extension' may work, and it is mentioned in most of the dynamic signature tutorials I've seen on Trap17, but it is a little 'hackish' and certainly not the way to go if you can avoid it.
Go to the top of the page
 
+Quote Post
shadowx
post Oct 6 2006, 01:51 PM
Post #4


A clever man learns from his own mistakes, a WISE man learns from those of OTHERS
***********

Group: [HOSTED]
Posts: 1,028
Joined: 12-April 06
From: Essex, UK
Member No.: 21,719



This is one way of doing it and i think its the way that many of the dynamic sigs here work. The image is a link to a php script that simply writes some text onto an image background and sends it to the browser as an image.

http://uk2.php.net/gd

That site is all about the gd image library which you will need to install. Depending on what system you are using it might already be installed. To check just use phpinfo(); and check on the GD library area to see if its installed.

If not that link has another link where you can find the GD library.

Once installed and if you have read through that link above you should be able to take the first steps into image manipulation using PHP. Its not too difficult once youve practiced. Start by writing text onto a background and move on from there smile.gif
Notice from jlhaslip:
Edit to remove faulty bbcode
Go to the top of the page
 
+Quote Post
juice
post Oct 18 2006, 06:27 PM
Post #5


Premium Member
********

Group: Members
Posts: 183
Joined: 24-July 06
From: Cape Town
Member No.: 27,194



It's like using the GD library to create an image like for an info image that displays your browser, IP, time, date and hits. The only problem is that not all hosts support it or even have it and I haven't tried it on trap's servers yet.
Go to the top of the page
 
+Quote Post
farsiscript
post Oct 18 2006, 06:55 PM
Post #6


Super Member
*********

Group: Members
Posts: 357
Joined: 8-April 06
Member No.: 21,487



dear elrohir You must Use GD Fucn
i agree mr shadowx , yes you can find info at http://uk2.php.net/gd or search gd at php.net wbesite
Go to the top of the page
 
+Quote Post
Tsunami
post Oct 18 2006, 08:40 PM
Post #7


Premium Member
********

Group: Members
Posts: 169
Joined: 2-August 06
From: North Carolina
Member No.: 27,662



made you a quick little example of how to do it..

http://tsunamicentral.trap17.com/index.php?pageid=imggen

it creates a image "on the fly" from the given text... hope you like

i can give you the code for a sig if you want >.< but im not sure if your just wanting an answer to your quesiton or if you actually want a dynamic sig
Go to the top of the page
 
+Quote Post
electron
post Oct 19 2006, 05:41 AM
Post #8


Premium Member
********

Group: Members
Posts: 162
Joined: 10-May 06
Member No.: 23,375



Well i made one whole site for users who could enter their own text and then it shows a random image with a random text entered by the user.
I use around 23 images in random.

Also a very powerful tool in Apace is mod_rewrite rule that can show something like http://www.trap17.com/index.php?image=electron to:
http://www.trap17.com/electron.png

Thats one cool stuff i loved to play with.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Blocking Pages & Making Ranks(4)
  2. Intranet Search Engine(4)
  3. How To Make Oscommerce Work With Phpbb(1)
  4. Script Won't Work At Trap17 -- Version Differences?(12)
  5. Just Wondering If Anyone Uses Vbulletin,vbadvanced & Photopost?(3)
  6. Form Dosn't Submit In Opera(1)
  7. Error Importing Sql Query Via Php(6)
  8. Making A New Bbcode For Smf 1.09(0)
  9. Making This Compatable With Trap17's Php(2)
  10. Help Improving My Login Script Code(4)
  11. Making Sure They Did Not Leave Any Required Fields Blank(3)
  12. How Would I Go About Making A Simple "counting" Script?(3)