View previous topic :: View next topic |
Author |
Message |
ntloc -
Joined: 26 Feb 2004 Posts: 35 Location: UT
|
Posted: Tue Mar 09, 2004 12:12 am Post subject: php script error Undefined? |
|
|
Hi, I have a little PHP script but when I run it, it showed this error:
Notice: Undefined variable: vhost in D:\MY ERVER\IPconvert\files\IPfile.php on line ...
Notice: Undefined variable: vhost in D:\MY ERVER\IPconvert\files\IPfile.php on line ..
Notice: Undefined variable: host in D:\MY SERVER\IPconvert\files\IPfile.php on line ...
Notice: Undefined variable: vhost in D:\MY SERVER\IPconvert\files\IPfile.php on line 55
Notice: Undefined variable: ip in D:\MY SERVER\IPconvert\files\IPfile.php on line ...
Notice: Undefined variable: out in D:\MY SERVER\IPconvert\files\IPfile.php on line ...
I though PHP script rarely used to define variables, but rather, the variables are being defined automatically it would seem. The variables seem to just grab the values without actually defining them with those elements. Is my ideas about PHP script, right? I'm not very good at PHP script (just starting to learn it for a few past days), can you show me how to define that variable "vhost" or fix it for me?
Here is the short code that it gave me that errors
<?php
echo "<big>Your current IP (WAN):</big> :{$_SERVER['REMOTE_ADDR']}<br><br>";
extract($_REQUEST);
if($vhost)
$host = $vhost;
if($host)
$out = @gethostbyname($host);
if($vhost)
$ip = $out;
if($ip)
$out = @gethostbyaddr($ip);
echo "<big><b>Result: $out</b></big>";
?>
Appreciate your help. |
|
Back to top |
|
 |
iNaNimAtE -
Joined: 05 Nov 2003 Posts: 2381 Location: Everywhere you're not.
|
Posted: Tue Mar 09, 2004 12:37 am Post subject: |
|
|
You know, you can just display a user's IP address by using one line of SSI. _________________ Bienvenidos! |
|
Back to top |
 |
 |
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
|
Back to top |
|
 |
|