Superglobal Variable Problem
Posted: Sat Feb 03, 2007 3:57 pm
feyd | Please use
When I open this file in my browser (Firefox), nothing at all is displayed, including the non-variable strings. Nothing at all appears in the browser. Yet if I run the phpinfo() function, all of the superglobal (among many others) variables display perfectly. I have tried using the 'echo' function instead - still I get the same result. I'm running Apache 2.2.4 and PHP 5.2.0, and I've tried this in both Firefox and IE. Any ideas, suggestions?
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi, I've just begun working with PHP, and I've run into a problem displaying superglobal variables. Here is the code I'm using:Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>superglobals</title>
<meta http-equiv="Content-Type"
content="text/html"; charset=utf-8" />
</head>
<body>
<?php
print "Your IP Address is: $_SERVER['REMOTE_ADDR'] <br />";
print "Your browser is: $_SERVER['HTTP_USER_AGENT']";
?>
</body>
</html>feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]