![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
07/06/2006, 09:41
|
| | Fecha de Ingreso: diciembre-2005 Ubicación: Barcelona
Mensajes: 1.428
Antigüedad: 19 años, 1 mes 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 |