Register | Login
Views: 19364387
Main | Memberlist | Active users | ACS | Commons | Calendar | Online users
Ranks | FAQ | Color Chart | Photo album | IRC Chat
11-02-05 12:59 PM
0 user currently in Programming. | 3 guests
Acmlm's Board - I2 Archive - Programming - w00t, my first PHP script
  
User name:
Password:
Reply:
 

UserPost
Xtreme984
Posts: 7/111
I used the base code of the new image thing which shows your IP, I just expanded the code to let it show a random avatar in the dialog or let it get quotes from my database
Cellar Dweller
Posts: 105/269
Originally posted by ProtoGuts
Xtreme984... Just thought I'd let you know that your thing in your sig doesn't show my ip... it show's someone else's...


The address in the image is the address that the server receives the request from. If the request passes through a NAT firewall or proxy, the server sees the address of the NAT firewall or proxy.
DarkSlaya
Posts: 972/4249
Originally posted by ProtoGuts
Xtreme984... Just thought I'd let you know that your thing in your sig doesn't show my ip... it show's someone else's...


Weird, it shows mine. I even tested it.
ProtoGuts
Posts: 2/9
Xtreme984... Just thought I'd let you know that your thing in your sig doesn't show my ip... it show's someone else's...
Xtreme984
Posts: 6/111
I know how to mess with PHP & GD but not that much, I can make simple text but no pics for signature.


I just learned how to use the function: imagecreatefrompng(); the rest is the same.
I have now succeeded in getting the avatar to be random, need some more avatars ripped from Megaman Battle Network 4.

EDIT: now added a random quote function
HyperLamer
Posts: 1420/8210
Originally posted by Xkeeper
$variable_omg = fopen("file name, stupid.blah","w");
fwrite($variable_omg, $variable_you_morons);
fclose($variable_omg);

Cool, thanks.
DarkSlaya
Posts: 931/4249
Originally posted by Xtreme984
actually what do you mean with at that level?


I know how to mess with PHP & GD but not that much, I can make simple text but no pics for signature.
Xtreme984
Posts: 5/111
thanks DarkSlayr, I'm now trying to make it so the dialog has a random avatar at refresh or reload, actually what do you mean with at that level?
DarkSlaya
Posts: 926/4249
Xtreme984: It's nice. I wish I could do things like that (well, I can but not at that level).
Xtreme984
Posts: 4/111
I've made another cool signature thing

Xkeeper
Posts: -3428/-863
Originally posted by Ranko
I couldn't see how with plain text.

You ought to try putting that in an image, I mean I've seen some people use similar scripts in their sig. 'You are 255.255.255.255. You need hit over the head with a large sack of shit.' et cetera et cetera...


Couldn't resist.

Oh, and to answer:

$variable_omg = fopen("file name, stupid.blah","w");
fwrite($variable_omg, $variable_you_morons);
fclose($variable_omg);

foo and bar are too overused.
HyperLamer
Posts: 1370/8210
Well since this thread is still here... I want to be able to check my IP remotely. I've installed TightVNC so I can do stuff like transfer files to whatever computer I'm actually using, but it doesn't do much good if I don't have the IP. What I thought I'd do is write a PHP script that writes the most recent IP to a file (clearing whatever used to be in the file). Using WinXP's ability to use HTML files as a desktop image without screwing everything up, I figured I'd simply make the background contain a reference to the file via image tag or some such thing. (Whenever the desktop loads, it tries to load the PHP file, which executes it.) So how can I do this? (In short: I need to know how to delete a file or clear its contents and write a variable to it. Also, for unrelated stuff, I'd like to know how to catch parameters in URLs, like '?something=pie&anotherthing=toast'.)
Xtreme984
Posts: 1/111
How can I make the images background color transparant


EDIT: Nevermind. in this case use

imagecolortransparant($im, $background_color);
Modereb
Posts: 35/75
Originally posted by Elric
Hmm...



Heh. That was easy.

Now, if I wanted to make the image say, "Your IP Adress Is x.x.x.x", how would that work? I'm thinking it would be something like this:

imagestring($im, 1, 5, 5, "Your IP Address Is ".$REMOTE_ADDR.", $text_color);

Is that right, or would that screw it up? Bah, I'll just try it now...

Nope. Didn't work. Didn't think it would...
That's because apperantly, you still need a syntax lesson:

imagestring($im, 1, 5, 5, "Your IP Address Is ".$REMOTE_ADDR."", $text_color);

-OR-

imagestring($im, 1, 5, 5, "Your IP Address Is ".$REMOTE_ADDR, $text_color);

-OR-

imagestring($im, 1, 5, 5, "Your IP Address Is $REMOTE_ADDR", $text_color);
Gavin
Posts: 72/799
Originally posted by Modereb
...You made a whole thread just because you used $REMOTE_ADDR? Please...


as he said, it's his first testing with PHP. if you don't have something nice to say, don't say anything at all



anyway HH: looking pretty cool. From there you can use $REMOTE_ADDR to make a fun counter script for unique IP addresses if you're really bored and looking for something new to test
Elric
Posts: 239/687
Hmm...



Heh. That was easy.

Now, if I wanted to make the image say, "Your IP Adress Is x.x.x.x", how would that work? I'm thinking it would be something like this:

imagestring($im, 1, 5, 5, "Your IP Address Is ".$REMOTE_ADDR.", $text_color);

Is that right, or would that screw it up? Bah, I'll just try it now...

Nope. Didn't work. Didn't think it would...
Kwan
Posts: 619/1137
There's a programming forum for this. Use it.
Modereb
Posts: 32/75
...You made a whole thread just because you used $REMOTE_ADDR? Please...
Darth Coby
Posts: 621/1371
Originally posted by HyperHacker
How what? How I put it on another page? <iframe src=http://hypernova.amarok-shadow.com/ip.php></iframe> - not that hard. Putting it in an image is way out of my league at the moment anyway.

<?php
header("Content-type: image/png");
$im = @imagecreate(75, 15)
or die("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate($im, 255, 255, 255);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5, "A Simple Text String", $text_color);
imagepng($im);
imagedestroy($im);
?>
That's what you're looking for. To make it show your IP you can just replace the "A simple text string" with $REMOTE_ADDR.
(imagestring($im, 1, 5, 5, $REMOTE_ADDR, $text_color);
HyperLamer
Posts: 1121/8210
How what? How I put it on another page? <iframe src=http://hypernova.amarok-shadow.com/ip.php></iframe> - not that hard. Putting it in an image is way out of my league at the moment anyway.
This is a long thread. Click here to view it.
Acmlm's Board - I2 Archive - Programming - w00t, my first PHP script


ABII


AcmlmBoard vl.ol (11-01-05)
© 2000-2005 Acmlm, Emuz, et al



Page rendered in 0.012 seconds.