Declaração de variaveis em php
Estou com duvidas de como inicializar umas variaveis em php, eu tento executar uma acão definida mas não dá certo. criei outro codigo mais não deu certo:
<br /><b>Notice</b>: Undefined variable: a in <b>C:\Program Files (x86)\EasyPHP-12.0\www\Classes\desafio.php</b> on line <b>9</b><br />
<html><head>
<title>VALENDO 1 PONTO</title>
</head>
<body>
<form name="form" method="post" action="?acao=ordenar">
VALENDO 1 PONTO
<br/><br/>
N1: <input type="text" name="a" id="a" size="5" value="<?php echo $a; ?>">
<br/><br/>
N2: <input type="text" name="b" id="b" size="5" value="<?php echo $b; ?>">
<br/><br/>
N3: <input type="text" name="c" id="c" size="5" value="<?php echo $c; ?>">
<br/><br/>
<input type="submit" name="bt" value="Ordenar">
</form>
</body>
</html>
<?php
if(isset($_get['acao']) && $_get['acao'] == 'ordenar')
{
if ($a <= $b && $a <= $c)
{
if ($b <= $c)
{
echo $a."".$b."".$c;
}
else
{
echo $a."".$c."".$b;
}
}
if ($b <= $a && $b <= $c)
{
if ($a <= $c)
{
echo $b."".$a."".$c;
}
else
{
echo $b."".$c."".$a;
}
}
if ($c <= $a && $c <= $B)
{
if ($a <= $B)
{
echo $c."".$a."".$b;
}
else
{
echo $c."".$b."".$a;
}
}
}
?>Discussão (2)
Carregando comentários...