s10jam Posted January 25, 2008 Share Posted January 25, 2008 This is kind of a hard thing to search on, so bear with me. When I run a page with phpinfo() function in it, it works fine. However whenever I ad the function: <?php echo $REMOTE ADDR ?> The whole page is just blank is a browser. Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/87731-solved-php-not-working-properly/ Share on other sites More sharing options...
rajivgonsalves Posted January 25, 2008 Share Posted January 25, 2008 parse error.. turn your error reporting on in your php.ini display_errors = On error_reporting = E_ALL and the code should be <?php echo $SERVER['REMOTE_ADDR']; ?> Quote Link to comment https://forums.phpfreaks.com/topic/87731-solved-php-not-working-properly/#findComment-448721 Share on other sites More sharing options...
s10jam Posted January 25, 2008 Author Share Posted January 25, 2008 Thanks for the quick reply. I did what you suggested. Now I get this: Notice: Undefined variable: SERVER in /home/httpd/html/ip.php on line 10 Which is the line the code is on. Quote Link to comment https://forums.phpfreaks.com/topic/87731-solved-php-not-working-properly/#findComment-448728 Share on other sites More sharing options...
rajivgonsalves Posted January 25, 2008 Share Posted January 25, 2008 your code should be <?php echo $SERVER['REMOTE_ADDR']; ?> variable names cannot have spaces in them therefore its giving the error Quote Link to comment https://forums.phpfreaks.com/topic/87731-solved-php-not-working-properly/#findComment-448729 Share on other sites More sharing options...
PFMaBiSmAd Posted January 25, 2008 Share Posted January 25, 2008 Actually, the correct code should be - <?php echo $_SERVER['REMOTE_ADDR']; ?> http://www.php.net/manual/en/language.variables.predefined.php Quote Link to comment https://forums.phpfreaks.com/topic/87731-solved-php-not-working-properly/#findComment-448853 Share on other sites More sharing options...
s10jam Posted January 25, 2008 Author Share Posted January 25, 2008 Thanks guys. That worked great. Quote Link to comment https://forums.phpfreaks.com/topic/87731-solved-php-not-working-properly/#findComment-449177 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.