RES: [PHP-WIN] POST/GET problem
| From: | Rafael Soares | Date: | Fri, 05 Nov 2004 11:38:49 +0000 |
| Subject: | RES: [PHP-WIN] POST/GET problem | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-24894@lists.php.net to get a copy of this message | ||
You probably have register_globals turned off (this is a question of
security and performance).
You can turn it on changing your php.ini file, it's probably located in
C:\WINDOWS
Or try this in the beginning of your PHP file:
<?php
$name = $_POST['name'];
$surname = $_POST['surname'];
?>
Rafael Soares - AgênciaM
Fone: +55 11 4616-1394
-----Mensagem original-----
De: Martyn Kinder [mailto:martyn@czd.org.uk]
Enviada em: sexta-feira, 5 de novembro de 2004 07:25
Para: php-windows@lists.php.net
Assunto: [PHP-WIN] POST/GET problem
Hi,
I am not sure if this is the correct group for this problem, so apologies if
I have got this totally wrong.
I have just installed PHP5 on a Windows XP machine with IIS (PWS).
phpinfo() seems OK.
However, when I try the following test script:
name.html looks like:
<html>
<body>
<center>
<FORM METHOD="POST" ACTION="name2.php">
<table>
<tr>
<th width="15%" nowrap><b>First Name</b></th>
<td width="35%"><input type=text name =
"name"></td>
<th width="15%" nowrap><b>Last Name</b></th>
<td width="35%"><input type=text name =
"surname"></td>
</tr>
</table>
<table>
<INPUT TYPE="SUBMIT" VALUE="Submit" NAME="Submit">
<INPUT TYPE="RESET" VALUE="Reset" NAME="Reset">
</table>
</Form>
</center>
</body>
</html>
and
name2.php looks like:
<html>
<body>
<?php
$surname=strtoupper($surname);
?>
<?php echo("<h3>Hello"), $name, (" "), $surname,
("</h3>");?>
</body>
</html>
When I run the name.html script:
I get
Notice: Undefined variable: surname in c:\Inetpub\wwwroot\name2.php on line
5
Hello
Notice: Undefined variable: name in c:\Inetpub\wwwroot\name2.php on line 9
I think this works OK on PHP4 and Apache.
I have looked through the FAQ's etc. But I'm not sure if this is an idiot
fault or a configuration fault.
Is there a requirement to declare variables in PHP5 now?
Any suggestions please!
Thanks
Martyn
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php