RE: [PHP] Configuration problem i guess...
| From: | Simon Taylor | Date: | Fri, 18 Oct 2002 12:49:32 +0000 |
| Subject: | RE: [PHP] Configuration problem i guess... | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-120493@lists.php.net to get a copy of this message | ||
You can go into the php.ini and turn register globals on, but this is not
very good practice in your code as then your browser can be duped with
variables that weren't really posted by your form. The method you have used
is quite correct, but you can use $_POST for simpler code.
Cheers
Simon
-----Original Message-----
From: Mr. BuNgL3 [mailto:mrbungle@netcabo.pt]
Sent: 18 October 2002 13:51
To: php-general@lists.php.net
Subject: [PHP] Configuration problem i guess...
I experienced a problem yesterday and i know now what was the problem but i
want to know if there is any way to do this like the books tells u to do...
check it out...
i had a html with a login form and when i click submit it calls login.php
with this code...
<?
$logintxt = $HTTP_POST_VARS['logintxt'];
$passwdtxt= $HTTP_POST_VARS['passwdtxt'];
if (!$logintxt || !$passwdtxt) {
include('login.htm');
}
else {
echo "
<html>
<title>Updating</title>
<body><center>Sistema em construção</center></body>
</html>
";
}
?>
u need the two first lines to get the html variables passed to php...
i was wondering if is any configuration to make in apache or php to avoid
this problem? If is it possible to php get the html form variables directly
without typing this two lines...
$logintxt = $HTTP_POST_VARS['logintxt'];
$passwdtxt= $HTTP_POST_VARS['passwdtxt'];~
Thanks
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php