Reply to can I pass PHP var to JS ...?

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация