jueves, 31 de enero de 2013

Ejercicio: Propuesta_02.php


<?php
/*
Author:Andrea
Date: 31/01/2013
Nombre del Fichero: propuesta02.php
Descripción: Tarifa de precios
*/
?>
<html>
<head>
<title>Su tarifa</title>
<body bgcolor="violet"><font face="arial"> <font size="+1">

<p>
<?php


  
?>
<table border="1" cellpadding="10"><tr bgcolor="pink">
<?php
$edad =26;
switch ( $edad ) {
  case ($edad >= 0 && $edad <= 13):
print "<td><b>Ud. paga $edad € tarifa de niños!</td>";
  break;
 case ($edad >13 && $edad < 55 ):
print "<td><b>Ud. paga $edad € tarifa normal de adulto.</td>";
  break;
  case ($edad >55 && $edad <120 ):
print "<td><b>Ud. paga $edad € tarifa para mayores.</td>";
  break;  
  default:
    print "<td><b>Ud. no es humano.</td>";
  break;
 }
 ?>
</tr>
</table>
</font>
</body>
</html>

Ejercicio: Propuesta_02.html


<?php
/*
Author:Andrea
Date: 31/01/2013
Nombre del Fichero: propuesta02.html
Descripción: Tarifa de precios
*/
?>
<html>
<head>
<title>Tarifa de precios</title>
<body bgcolor="violet"><font face="arial black"> <font size="+1">
<form method="GET"  action="propuesta02.php">
</head>
<body>
<p> ¿Qué edad tienes?<br>
<input type="text" size=1 name="edad" <br /> 
<br>
<br>
<input type=submit name="enviar" value="Obtener tarifa" <br />
</body>
</html>

martes, 29 de enero de 2013

Ejercicio: eje7.3.php


<?php
/*
Autor: Andrea Rubio
Date: 25/01/2013
Descripcion: Color
Nombre de fichero: ejer7.3.php
Ultima modificacion:
*/
?>
<html>
<html><head><title>Font Color</title></head>
<body bgcolor="lightgreen">
<font face="arial" size="+1">

<?php
extract($_REQUEST);
if (! isset ($submit_color)){
exit;
}
?>

<table border="2" cellpadding="10">
<tr bgcolor="white">

<?php

switch ( $color ) {
case "red":
print "<td><b><font color=".$color.">La fuente es de color roja</td>";
break;
case "blue":
print "<td><b><font color=".$color.">La fuente es de color azul</td>";
break;
case "purple":
print "<td><b><font color=".$color."> La fuente es de color purpura</td>";
break;
case "green":
print "<td><b><font color=".$color."> La fuente es de color verde</td>";
break;
default:
print "<td><b><font color=".'black'."> La fuente es negra</td>";
break;
}

?>
</tr>
</table>

Ejercicio: eje7.3.html


<?php
/*
Autor: Andrea Rubio Mesa
Date: 25/01/2013
Descripcion: Formulario Operadores logicos
Nombre de fichero: ejer7.3.html
Ultima modificacion:
*/
?>

<html>
<head>
<title>Pink a Font color</title>
</head>
<body bgcolor="9BCD93">
<font face="arial" >
<b>
<form method="get" action="ejer7.3.php">
<br />Choose a font color:
<br /><input type="radio" name="color" value="red" checked="checked"/> rojo
<br /><input type="radio" name="color" value="blue"/> azul
<br /><input type="radio" name="color" value="purple"/> purpura
<br /><input type="radio" name="color" value="green"/> verde
<p>
<input type="submit" name="submit_color" value="enviar color" />
</form>
</b>
</body>
</html>

lunes, 28 de enero de 2013

Ejercicio: eje7.2.php


<?php
/*
Author:Andrea
Date: 28/01/2013
Nombre del Fichero: 7.2 php
Descripción: Tarifa de precios
*/
?>
<html>
<head>
<title>Su tarifa</title>
<body bgcolor="violet"><font face="arial"> <font size="+1">

<p>
<?php

 extract($_REQUEST);
if ( ! isset ($enviar )) { // Get form input
  exit;
  }
  
?>
<table border="1" cellpadding="10"><tr bgcolor="pink">
<?php
  if ($edad > 0 && $edad < 13) {
    $price = 5.00;
print "<td><b>Ud. paga $price € tarifa de niños!</td>";
  }
  elseif ($edad >=13 && $edad < 55 ){
    $price = 8.25;
print "<td><b>Ud. paga $price € tarifa normal de adulto.</td>";
  }
  elseif ($edad >=55 && $edad <=120 ){
    $price = 10.00;
print "<td><b>Ud. paga $price € tarifa para mayores.</td>";
  }
  else {
    print "<td><b>Ud. no es humano.</td>";
  }
 ?>
</tr>
</table>
</font>
</body>
</html>

Ejercicio: eje7.2.html


<?php
/*
Author:Andrea
Date: 28/01/2013
Nombre del Fichero: 7.2 HTML
Descripción: Tarifa de precios
*/
?>
<html>
<head>
<title>Tarifa de precios</title>
<body bgcolor="violet"><font face="arial black"> <font size="+1">
<form method="GET"  action="ex7.2.php">
</head>
<body>
<p> ¿Qué edad tienes?<br>
<input type="text" size=1 name="edad" <br /> 
<br>
<br>
<input type=submit name="enviar" value="Obtener tarifa" <br />
</body>
</html>

Ejercicio: eje.7.1.php


<?php
/*
Author:Andrea
Nombre del Fichero: 7.1 php
Descripción: Tarifa de precios
*/
?>
<html>
<head>
<title>Tarifa de precios</title>
<body bgcolor="violet"><font face="arial"> <font size="+1">


<p>
<?php

 extract($_REQUEST);
if ( ! isset ($enviar )) { // Condicional Simple
  exit;
  }
  
?>
<table border="1" cellpadding="10"><tr bgcolor="white">
<?php

 if ($edad >= 55){
    $price = 8.25;
print "<td><b>Su pago es de $price €, tarifa para mayores!</td>";
  }
   else{
    $price = 10.00;
print "<td><b>Su pago es de $price €, tarifa regular.</td>";
}

?>