same question as before:
have you got register_globals turn on or off ?

-----Original Message-----
From: J. P. [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 25, 2003 10:57 AM
To: [EMAIL PROTECTED]
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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to