RE: [PHP] sript doesn't work
| From: | Martin Towell | Date: | Fri, 28 Mar 2003 02:15:46 +0000 |
| Subject: | RE: [PHP] sript doesn't work | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-141349@lists.php.net to get a copy of this message | ||
same question as before:
have you got register_globals turn on or off ?
-----Original Message-----
From: J. P. [mailto:cybermack@oninet.pt]
Sent: Tuesday, March 25, 2003 10:57 AM
To: php-general@lists.php.net
Subject: [PHP] sript doesn't work
Hello!
I am using Apache 2.0.44 and WinXP. I have PHP 4.3.1.
When i run the script the first page appears. But when i submit nothing
appends. What's wrong?
<?php
function mostrar_formulario()
{
global $PHP_SELF;
?>
<form action="<?php echo $PHP_SELF; ?>" method="post">
Nome: <input type="text" name="nome" maxlength="50"><br>
Email: <input type="text" name="email" maxlength="50"><br>
<br>
Qual a sua linguagem de programação preferida?<br>
<input type="radio" name="linguagem" value="PHP">PHP<br>
<input type="radio" name="linguagem" value="C++">C++<br>
<input type="radio" name="linguagem" value="C">C<br>
<input type="radio" name="linguagem" value="PERL">PERL<br>
<br>
Qual o seu browser web preferido?<br>
<input type="radio" name="browser" value="Netscape
Navigator">Netscape
Navigator<br>
<input type="radio" name="browser" value="Internet
Explorer">Internet
Explorer<br>
<br>
<input type="submit" value="Submeter dados">
</form>
<?php
}
?>
<?php
function processa_formulario() {
global $nome;
global $email;
global $linguagem;
global $browser;
printf ("O utilizador %s cujo endereço de email é %s prefere a linguagem de
programação %s e utiliza, normalmente, o browser %s para navegar na www.",
$nome, $email, $linguagem, $browser);
}
?>
<?php
if (empty($nome)){
mostrar_formulario();
} else {
processa_formulario();
}
?>
Thanks
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php