Hoy se realizo el acumulativo.
EJERCICIO
de código ascii pasa a letras.
<html>
<head><title>praccticca</title></head>
<body>
<form method="post">
<font color="red"><label>Escriba un numero</label></font>
<input type="number" required name="a"></br>
<hr>
<input type="submit">
</form>
</body>
<?php
@$e = $_POST['a'];
@$t = chr($e);
echo "$t";
?>
</html>
jueves, 24 de agosto de 2017
martes, 22 de agosto de 2017
EJERCICIO DEL PROYECTO
<form method="post">
<label>Variable a</label><input type="number" name="a"></br>
<label>variable b</label><input type="number" name="b"></br>
<label>variable c</label><input type="number" name="c"></br>
<input type="submit" value="enviar"></br>
</form>
<?php
$a =$_POST['a'];
$b =$_POST['b'];
$c =$_POST['c'];
if ($a == 0){echo "Error matematico";}
else{
$parteraiz = ($b*$b)-4*$a*$c;
if ($parteraiz < 0){
$imaginario = sqrt(($parteraiz * -1));
$x1 = ((-$b + $parteraiz)/2*$a) . "<font color='red'>i</font>";
$x2 = ((-$b - $parteraiz)/2*$a) . "<font color='red'>i</font>";
echo "<table border='1'><tr><td>Raiz imaginaria</td></tr><tr><td>X1 = $x1</td></tr><tr><td>X2 = $x2</td></tr></table>";
}
else{
$x1 = (-$b + sqrt($parteraiz))/2*$a;
$x2 = (-$b - sqrt($parteraiz))/2*$a;
echo "X<sub>1</sub> = $x1<br>X<sub>2</sub> = $x2";
}
}
?>
<label>Variable a</label><input type="number" name="a"></br>
<label>variable b</label><input type="number" name="b"></br>
<label>variable c</label><input type="number" name="c"></br>
<input type="submit" value="enviar"></br>
</form>
<?php
$a =$_POST['a'];
$b =$_POST['b'];
$c =$_POST['c'];
if ($a == 0){echo "Error matematico";}
else{
$parteraiz = ($b*$b)-4*$a*$c;
if ($parteraiz < 0){
$imaginario = sqrt(($parteraiz * -1));
$x1 = ((-$b + $parteraiz)/2*$a) . "<font color='red'>i</font>";
$x2 = ((-$b - $parteraiz)/2*$a) . "<font color='red'>i</font>";
echo "<table border='1'><tr><td>Raiz imaginaria</td></tr><tr><td>X1 = $x1</td></tr><tr><td>X2 = $x2</td></tr></table>";
}
else{
$x1 = (-$b + sqrt($parteraiz))/2*$a;
$x2 = (-$b - sqrt($parteraiz))/2*$a;
echo "X<sub>1</sub> = $x1<br>X<sub>2</sub> = $x2";
}
}
?>
viernes, 18 de agosto de 2017
martes, 15 de agosto de 2017
EJERCICIO
EJERCICIO DE PRACTICA PARA EL PROYECTO.
<html>
<head>
<title>Practica</title>
</head>
<body>
<form method="post">
<label>Digite su nombre</label><input type="text" name="nombre" required></br></br></br>
<label>Telefono</label><input type="number" name="telefono" pattern="[0-9]{7}" required></br></br></br>
<label>Motivo</label><select name="seleccion" required>
<option></option>
<option value="a">Arreglos de nota</option>
<option value="b">Sugerencia</option>
<option value="c">Tema</option>
</select></br></br></br>
<label>Observaciones</label></br><textarea rows="9" cols="70" name="obs"></textarea></br></br></br>
<input type="submit">
</form>
</body>
<?php
if (isset($_POST['seleccion']))
{
$seleccion = $_POST['seleccion'];
$obser = $_POST['obs'];
if ($seleccion == "a")
{ echo substr("$obser", 0, 10);}
else if ($seleccion == "b"){
echo "<b>" . ucfirst($obser). "</b>" ;}
else if ($seleccion == "c")
echo "<a href='$obser' target='_blank'>$obser</a>";
else{}
}
?>
</html>
<html>
<head>
<title>Practica</title>
</head>
<body>
<form method="post">
<label>Digite su nombre</label><input type="text" name="nombre" required></br></br></br>
<label>Telefono</label><input type="number" name="telefono" pattern="[0-9]{7}" required></br></br></br>
<label>Motivo</label><select name="seleccion" required>
<option></option>
<option value="a">Arreglos de nota</option>
<option value="b">Sugerencia</option>
<option value="c">Tema</option>
</select></br></br></br>
<label>Observaciones</label></br><textarea rows="9" cols="70" name="obs"></textarea></br></br></br>
<input type="submit">
</form>
</body>
<?php
if (isset($_POST['seleccion']))
{
$seleccion = $_POST['seleccion'];
$obser = $_POST['obs'];
if ($seleccion == "a")
{ echo substr("$obser", 0, 10);}
else if ($seleccion == "b"){
echo "<b>" . ucfirst($obser). "</b>" ;}
else if ($seleccion == "c")
echo "<a href='$obser' target='_blank'>$obser</a>";
else{}
}
?>
</html>
sábado, 12 de agosto de 2017
AGOSTO 9 DEL 2017
hoy se hizo una prueba de como se hará el proyecto.
OPERADORES LOGICOS PHP
&a and $b -y- si tanto $a como $b son verdaderas.
&a or $b - o inclusivo - si cualquiera de $a o $b es verdadera.
&a xor $b - o exclusivo- si $a o $b son verdaderas, pero no ambas.
!&a - no - si $a no es verdadera .
&a && $b - y - si tanto &a como$b son verdaderas.
&a || $b -o inclusive- si cualquiera de $a o $b son verdaderas.
&a == $b - igual.
&a != $b - diferente.
BUCLES
while()- Ejecuta una parte del programa mientras se cumpla una condición.
while(condición){sentencias}
for
for($variable = valor inicial; condición; incremento)
IF..ELSE
if(expresión){sentencias}
else{sentencias}
CADENAS
strlen() - obtiene la longitud de una cadena y devuelve un numero.
substr() - muestra partes de la cadena.
substr($cadena,2) - muestra la cadena hasta la senda letra.
substr($cadena,2,2) - muestra desde la letra más las siguientes letras.
STRTOLOWER Y STRTOUPPER
strtolower($variable) - minúsculas.
strtoupper($variable) - mayúsculas.
UCFIRST - Pone en la cadena la primera letra en mayúsculas
OCWORDS - Todas las palabras con la primera letra en mayúsculas.
martes, 8 de agosto de 2017
AGOSTO 2 DEL 2017
Hoy resolvimos dudas sobre los ejercicios realizados en casa.
Se realizo evaluación sobre temas vistos.
Ejercicio php.
Programa que lee 2 números y realiza las operaciones básicas: suma, resta, multiplicación y división.
<html>
<head><title>ejercicio3</title></head>
<body>
<form method="post">
<label>ingrese el numero 1</label><input type="tex" name="numero1"></br>
<label>ingrese el numero 2</label><input type="tex" name="numero2">
<input type="submit" name="boton" value="enviar">
</form>
</body>
<?php
@$a = $_POST['numero1'];
@$b = $_POST['numero2'];
$c = $a + $b;
$d = $a - $b;
$e = $a * $b;
$f = $a / $b;
echo "la suma = ",$c; ?></br>
<?php echo "la resta = ",$d; ?></br>
<?php echo "la multiplicacion = ",$e; ?></br>
<?php echo "la division = ",$f; ?>
</html>
Se realizo evaluación sobre temas vistos.
Ejercicio php.
Programa que lee 2 números y realiza las operaciones básicas: suma, resta, multiplicación y división.
<html>
<head><title>ejercicio3</title></head>
<body>
<form method="post">
<label>ingrese el numero 1</label><input type="tex" name="numero1"></br>
<label>ingrese el numero 2</label><input type="tex" name="numero2">
<input type="submit" name="boton" value="enviar">
</form>
</body>
<?php
@$a = $_POST['numero1'];
@$b = $_POST['numero2'];
$c = $a + $b;
$d = $a - $b;
$e = $a * $b;
$f = $a / $b;
echo "la suma = ",$c; ?></br>
<?php echo "la resta = ",$d; ?></br>
<?php echo "la multiplicacion = ",$e; ?></br>
<?php echo "la division = ",$f; ?>
</html>
Suscribirse a:
Entradas (Atom)