Skip to content

Instantly share code, notes, and snippets.

@nicolapiz
nicolapiz / Ej2.html
Created March 2, 2014 17:47
documento que contiene el formularios con los nombres del usuario que vamos a insertar en la base de datos
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Ejercicio 2</title>
</head>
<body>
<form action="Ej2.php" method="post" id="frm1" name="frm1">
@nicolapiz
nicolapiz / Clase.php
Created March 2, 2014 17:45
Clase php contiene varias clases que nos son utiles para conectar a la base de datos, hacer consultas y declarar objetos usuarios
<?php
class Conexion // se declara una clase para hacer la conexion con la base de datos
{
var $con;
function Conexion()
{
// se definen los datos del servidor de base de datos
$conection['server']="localhost"; //host
$conection['user']="alumno"; // usuario
$conection['pass']="alumnodaw"; //password
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Ejercicio 1 html</title>
</head>
<body><!--Creamos un formulario con varios campos y el boton de enviar los datos al Ej1.php-->
<form action="Ej1.php" method="post" id="frm1" name="frm1">
<label id="nombre">Nombre:</label><input type="text" name="name" id="name"/><br />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Ejercicio 1</title>
</head>
<!--Recuperamos y mostramos en texto plano los datos recuperados del formulario-->
<?php
$name=$_POST["name"];
$surname=$_POST["surname"];