|
Posted by Tamarin on 03/06/07 04:47
Hello,
new @ php and was wondering if I can pass on a PHP variable to Javascript
for returning an IP number in a form. I use a PHP snippet below to advise
potential members of a forum that their IP is being recorded (as all
web-servers are capable of), but I am wondering if there is some way to pass
the PHP variable to a hidden form-field variable that would return the IP
number via the form processor?
here is the IP image generator, "ip_number.php"
========================
<?php
$img_number = imagecreate(310,25);
$backcolor = imagecolorallocate($img_number,197,215,218);
$textcolor = imagecolorallocate($img_number,0,0,128);
imagefill($img_number,0,0,$backcolor);
$number = " Your IP number is $_SERVER[REMOTE_ADDR]";
Imagestring($img_number,10,5,5,$number,$textcolor);
header("Content-type: image/jpeg");
imagejpeg($img_number);
?>
================================
I reference this file to display the image in my application like so:
<p align="center"><img src="../ip_number.php" border="1"></p>
thanks for any assistance with this question.
TM
[Back to original message]
|