Hi again, just trying out what was cleared to me in my other post, but now i've encnountered another problem:
I have this form, you type in Name, Last name and comment, press submit and values are sent to a function on another file, but i cant get the function to use the values sent over.
Thanks!!!!!!
//This is the form page(index.php)
<body>
<form method="post" name="form1" action="index.php">
<p>
Nombre:<br>
<input name="nombre" type="text">
</p>
<p align="left">Apellido:<br>
<input name="apellido" type="text">
</p>
<p>Comentarios:
<br>
<textarea name="comentarios" rows="5" wrap="physical"></textarea>
</p>
<p>
<input type="submit" name="btn1" value="Enviar">
<input type="submit" name="btn2" value="Mostrar Resultados">
<br>
</p>
</form>
<?
require "funcs.php";
if ($_POST['btn1']=="Enviar")
{
add_reg(($_POST[$nombre]),($_POST[$apellido]),($_POST[$comentario]));
//echo "Su registro se agrego, Gracias!<br>";
}
else if ($_POST['btn2']=="Mostrar Resultados")
{
showme();
}
else {}
?>
</form>
</body>
<?PHP
//This is the function pgae (funcs.php)
function add_reg($nombre,$apellido,$comentario)
{
echo $nombre." ".$apellido." ".$comentario;
}
?>