variable with no value!!!

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

parxal
New php-forum User
New php-forum User
Posts: 40
Joined: Thu Nov 07, 2002 5:58 am

variable with no value!!!

Postby parxal » Fri Nov 08, 2002 4:01 am

on index.php

<form name="form1" method="post" action="enviar.php">
<p>Nome :
<input type="text" size=40 name="nome">
</p>
<p>Morada:
<input type="text" size=40 name="morada">
</p>
<p>Email:
<input type="text" size=40 name="email">
</p>
<p>Url:
<input type="text" size=40 name="url">
</p>
<p>
<input type="submit" name="submit" value="Enter information">

</form>


on enviar.php
<?
echo $nome
?>

This code isn't working, it doesn´t write anything! $nome variable is null, why? can anyone help me?

User avatar
Oleg Butuzov
Last Samuray
Last Samuray
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Postby Oleg Butuzov » Fri Nov 08, 2002 4:32 am

if (isset($nome))
{
echo "$nome";
}

parxal
New php-forum User
New php-forum User
Posts: 40
Joined: Thu Nov 07, 2002 5:58 am

the problem is not that!

Postby parxal » Fri Nov 08, 2002 11:17 am

i fill the field "nome" in the form, and the variable $nome is empty!
why?

User avatar
Oleg Butuzov
Last Samuray
Last Samuray
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Postby Oleg Butuzov » Fri Nov 08, 2002 1:08 pm

I tested your script it works!


<?
echo $nome;
?>

P.S.
What version oh PHP you use ?


Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 1 guest