php script error Undefined?

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
ntloc
-


Joined: 26 Feb 2004
Posts: 35
Location: UT

PostPosted: Tue Mar 09, 2004 12:12 am    Post subject: php script error Undefined? Reply with quote

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 View user's profile Send private message Visit poster's website
iNaNimAtE
-


Joined: 05 Nov 2003
Posts: 2381
Location: Everywhere you're not.

PostPosted: Tue Mar 09, 2004 12:37 am    Post subject: Reply with quote

You know, you can just display a user's IP address by using one line of SSI.
_________________
Bienvenidos!
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Tue Mar 09, 2004 3:05 pm    Post subject: Re: php script error Undefined? Reply with quote

ntloc,

These are not errors, these are notices. Please read http://www.aprelium.com/forum/viewtopic.php?t=1140 to know how to disable them.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group