cvs: phpweb / tut.php

From: Date: Fri, 24 May 2002 19:16:11 +0000
Subject: cvs: phpweb / tut.php
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-10449@lists.php.net to get a copy of this message
derick Fri May 24 15:16:11 2002 EDT Modified files: /phpweb tut.php Log: - Update for autoglobals/ register globals being off Index: phpweb/tut.php diff -u phpweb/tut.php:1.13 phpweb/tut.php:1.14 --- phpweb/tut.php:1.13 Sun May 5 06:33:36 2002 +++ phpweb/tut.php Fri May 24 15:16:11 2002 @@ -104,12 +104,12 @@ variable we can simply do: </p> -<?php example('<?php echo $HTTP_USER_AGENT; ?>')?> +<?php example('<?php echo $_SERVER["HTTP_USER_AGENT"]; ?>')?> <p> For the browser that you are using right now to view this page, this displays: -<blockquote><?php echo $HTTP_USER_AGENT; ?></blockquote> +<blockquote><?php echo $_SERVER["HTTP_USER_AGENT"]; ?></blockquote> There are many other variables that are automatically set by your web server. You can get a complete list of them by creating a file that looks like this: @@ -131,8 +131,8 @@ </p> <?php example('<?php -if(strstr($HTTP_USER_AGENT,"MSIE")) { - echo "You are using Internet Explorer<br>"; +if (strstr($_SERVER["HTTP_USER_AGENT"], "MSIE")) { + echo "You are using Internet Explorer<br />"; } ?>');?> @@ -162,7 +162,7 @@ </p> <?php example('<?php -if(strstr($HTTP_USER_AGENT,"MSIE")) { +if (strstr($_SERVER["HTTP_USER_AGENT"], "MSIE")) { ?> <center><b>You are using Internet Explorer</b></center> <? @@ -182,7 +182,7 @@ </p> <?php -if (strstr($HTTP_USER_AGENT,"MSIE")) { +if (strstr($_SERVER["HTTP_USER_AGENT"], "MSIE")) { ?> <center><b>You are using Internet Explorer</b></center> <?php @@ -217,8 +217,8 @@ In this file you would have something like this: </p> -<?php example('Hi <?php echo $name; ?>. -You are <?php echo $age; ?> years old.')?> +<?php example('Hi <?php echo $_POST["name"]; ?>. +You are <?php echo $_POST["age"]; ?> years old.')?> <p> It should be obvious what this does. There is nothing more to it.

« previous php.mirrors (#10449) next »