Ver Mensaje Individual
  #1 (permalink)  
Antiguo 07/06/2006, 09:41
chefnelone
 
Fecha de Ingreso: diciembre-2005
Ubicación: Barcelona
Mensajes: 1.428
Antigüedad: 18 años, 4 meses
Puntos: 15
For y If no me funcionan (muy principiante)

Hola a todos
Estoy aprendiendo php y tengo estas primeras dudas.
No me funciona la estructura IF ni la FOR


Aqui están los dos codigos.

-----if.php-------------------------------------

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
$var = "Bob";
$Var = "Joe";
echo "$var, $Var";******// outputs "Bob, Joe"
if ($var == "Bob") {
****echo "el nombre es Bob";
}

?>
</body>
</html>



-----------for.php-----------------------------------------
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<?php
for ($i = 1; $i <= 10; $i++) {
*****print $i;
}
?>
</body>
</html>
gracias
saludos