PHP Image: How To Show A User Their IP In Your Signature. - Printable Version +- Support Forums (https://www.supportforums.net) +-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87) +--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18) +---- Forum: PHP The Hypertext Preprocessor (https://www.supportforums.net/forumdisplay.php?fid=21) +---- Thread: PHP Image: How To Show A User Their IP In Your Signature. (/showthread.php?tid=22062) |
PHP Image: How To Show A User Their IP In Your Signature. - BreShiE - 09-08-2011 First of all, I found this on http://www.thesitewizard.com/ so credits go to them for that but I'm writing this out myself. Requirements:
Okay first of go to your public_html in your cPanel, make a new directory called "img". Make a file called "index.php" (this then becomes the default page for the img directory) Inside the index.php, enter this following code: PHP Code: <?php Make Sure You Save It! Okay, that should be done, now go to http://www.YourDomain.com/img and you should see your IP. Go onto the forum of which you want this is your signature, go to the UserCP and click "Edit Signature". In your signature enter this following BBCode: Code: [img]http://www.YourDomainHere.com/img/index.php[/img] If you want to get the exact colours for the backgrounds of forums. so it looks just like the text then edit this: PHP Code: $background = imagecolorallocate( $my_img, 102, 102, 102 ); Change it to: HackForums PHP Code: $background = imagecolorallocate( $my_img, 102, 102, 102 ); SupportForums PHP Code: $background = imagecolorallocate( $my_img, 87, 87, 87 ); You're Done! Congratulations! Now Go Freak Out Some People RE: PHP Image: How To Show A User Their IP In Your Signature. - Fox - 09-13-2011 This is a very nice tutorial. I tried this and it works perfectly. RE: PHP Image: How To Show A User Their IP In Your Signature. - SaNƹ - 09-13-2011 Interesting tutorial. I've always wondered how to do something like this. I'll be keeping these pieces of code as reference. Thanks. RE: PHP Image: How To Show A User Their IP In Your Signature. - ₠o™ - 09-14-2011 Yeah this is really nice tutorial and I will try this out later. RE: PHP Image: How To Show A User Their IP In Your Signature. - Kom - 09-14-2011 How would you go about putting this into an image? Like if I were to make an avatar or a signature and want it to spit out the Ip? Any ideas? RE: PHP Image: How To Show A User Their IP In Your Signature. - Fragma - 09-14-2011 Very useful. Thanks for sharing. I probably won't use it but it's nice to know how to do it anyway. RE: PHP Image: How To Show A User Their IP In Your Signature. - BreShiE - 09-14-2011 (09-14-2011, 03:10 AM)Kom Wrote: How would you go about putting this into an image? Like if I were to make an avatar or a signature and want it to spit out the Ip? Any ideas? This code does create it into an image, if afterwards, once you've done this, go visit the link and you'll see the exact same of what's in my signature. RE: PHP Image: How To Show A User Their IP In Your Signature. - Gaijin - 09-17-2011 I've posted quite few GD tutorials on here, lurk for them... Anyway, this is nothing new or original, the one thread on here is original... http://www.supportforums.net/showthread.php?tid=1664 RE: PHP Image: How To Show A User Their IP In Your Signature. - alabama - 10-15-2011 The HF background should be RGB: 51, 51, 51 instead of 102, 102, 102. Nice tutorial nonetheless, similar to my text image in php RE: PHP Image: How To Show A User Their IP In Your Signature. - Contribution - 11-08-2011 Nice to know. Very useful. I might edit the script to keep logs in the future . |