Hola a todos, tengo una base de datos mysql dentro del server donde alojo mi web.
Me gustaria introducir unos datos en esa base de datos a traves de mi formulario...
El formulario es el siguiente:
<html>
<head><title>Ingreso Clientes en Base de Datos</title>
<body>
<center>
<BR><BR>
<h1><b>Ingreso Clientes Base de Datos</b></h1>
<BR><BR><BR>
<form method="POST" action="intro.php">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="50%">Empresa:</td>
<td width="50%" align="center"><input size="20" name="empresa"></td>
</tr>
<tr>
<td width="50%">Contacto:</td>
<td width="50%" align="center"><input size="20" name="contacto"></td>
</tr>
<tr>
<td width="50%">Telefono</td>
<td width="50%" align="center"><input size="20" name="tlf"></td>
</tr>
<tr>
<td width="50%">Fax</td>
<td width="50%" align="center"><input size="20" name="fax"></td>
</tr>
<tr>
<td width="50%">Mail</td>
<td width="50%" align="center"><input size="20" name="mail"></td>
</tr>
<tr>
<td width="50%">Fecha</td>
<td width="50%" align="center"><input size="20" name="fecha"></td>
</tr>
</table>
<BR><BR><BR>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="50%">
<input type="submit" value="Registrar" name="registrar" ></td>
<td width="50%">
<input type="reset" value="Borrar Formulario" style="float: right" ></td>
</tr>
</table>
</form>
<br><br>
<center><a href=index.html><h3>Volver página principal</h3></a></center>
</head>
</body>
</html>
Este archivo se llama "intro.html"
Despues tengo otro archivo llamado "intro.php" que es el php siguiente:
<?php
class clientes_datos
{
var $empresa;
var $contacto;
var $tlf;
var $fax;
#var $mail;
var $fecha;
function ingreso($empresa,$contacto,$tlf,$fax,$mail,$fecha)
{
$this->empresa=$empresa;
$this->contacto=$contacto;
$this->tlf=$tlf;
$this->fax=$fax;
# $this->mail=$mail;
$this->fecha=$fecha;
if ($this->empresa=="" and $this->contacto=="" and $this->tlf=="" and $this->fax=="" and $this->fecha=="" )
{
echo "<center><b>Debes llenar los campo</center></b>";
}
else
{
#if($this->registrar==true)
{
if($this->empresa==true and $this->contacto==true and $this->tlf==true and $this->fax==true and $this->tlf==fecha )
{
mysql_connect("http://www.alfacat.net/phpMyAdmin/","usuario","password");
mysql_query("INSERT INTO clientes (empresa, contacto, tlf, fax, fecha) values ('$this->empresa','$this->contacto','$this->tlf, '$this->fax', '$this->fecha')");
mysql_close();
echo "<b><center>Registro ingresado</center></b>";
}
else
{
echo "<b><center>Debe llenar los campos</center></b>";
}
}
}
}}
?>
Donde conecto con la base de datos : mysql_connect("http://www.alfacat.net/phpMyAdmin/"
No se si es correcto.... estoy empiezo a estar bastane perdido...os agradeceria alguna ayuda...
cuando pulso el boton de enviar se queda la pagina en blanco pero no entro nada en la base de datos....
Gracias a todos de antemano por vuestro tiempo