PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
First of all, I'm a newby and i know i have like 30+ errors in this code.... I wanted to make a form where the user enter a numbers , and if the user enter the right number, it says he won, if he didn't enter the same number it says he lost, and if he enter nothing, display something like "You didn't entered any numbers"....
<?php
$premio = 123456;
$codigo = $_POST['codigo'];
//////////////////////////////////////
if (isset($_POST['codigo'])) {
echo "No ingresaste ningun codigo";
}else{
if ($_POST['codigo'] == $premio) {
echo "GANASTE!! llama al siguiente telefono para confirmar tus datos!!";
}else{
echo "No ganaste, pero sigue intentando!"; }
?>
<?php
$premio = 123456;
$codigo = $_POST['codigo'];
if (isset($_POST['codigo'])) {
echo "No ingresaste ningun codigo";
}else{
if ($_POST['codigo'] == $premio) {
echo "GANASTE!! llama al siguiente telefono para confirmar tus datos!!";
}else{
echo "No ganaste, pero sigue intentando!";
}
} <- You forgot to add this bracket
?>