Ver Mensaje Individual
  #7 (permalink)  
Antiguo 15/05/2004, 14:42
fido85
 
Fecha de Ingreso: mayo-2004
Ubicación: Barcelona
Mensajes: 200
Antigüedad: 20 años
Puntos: 0
El codigo es muy basura porq esta hecho con el dreamweaver...

con esto introduzco los datos a la pagina y con una libreria a la base de datos

<html>
<head>
<title>Incidencias</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</script>
</head>

<body background="tap/ieslpasi.jpg" onLoad="MM_preloadImages('tap/tab_consultas2.gif','tap/tab_incid&egrave;ncies2.gif','tap/tab_sortir2.gif');MM_preloadImages('tap/tab_llista2.gif','tap/tab_estadisticas2.gif','tap/tab_descarregues2.gif')">
<p align="center"> <font size="6" face="Times New Roman, Times, serif"><strong>INCID&Egrave;NCIES</strong></font></p>
<table width="964">
<tr>
<td width="983"><p align="center">&nbsp;</p>
<p align="center"><img src="tap/tabs_bar.gif" width="32" height="31"><img src="tap/tabs_bar.gif" width="32" height="31"><a href="Consulta.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('consultar','','tap/tab_consultas2.gif',1)"><img src="tap/tab_consultes.gif" name="consultar" width="110" height="31" border="0" onClick=src="tap/tab_cunsulta3.gif"></a><img src="tap/tabs_bar.gif" width="32" height="31"><img src="tap/tab_incidencies2.gif" width="110" height="31"><img src="tap/tabs_bar.gif" width="32" height="31"><a href="llista.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('lista','','tap/tab_llista2.gif',1)"><img src="tap/tab_llista.gif" name="lista" width="110" height="31" border="0"></a><img src="tap/tabs_bar.gif" width="32" height="31"><a href="estadistiques.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('estadistiques','','tap/tab_estadisticas2.gif',1)"><img src="tap/tab_estadisticas.gif" name="estadistiques" width="120" height="31" border="0"></a><img src="tap/tabs_bar.gif" width="32" height="31"><a href="descargas.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('descargas','','tap/tab_descarregues2.gif',1)"><img src="tap/tab_descarregues.gif" name="descargas" width="120" height="31" border="0"></a><img src="tap/tabs_bar.gif" width="32" height="31"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('salir','','tap/tab_sortir2.gif',1)"><img src="tap/tab_sortir.gif" name="salir" width="100" height="31" border="0"></a><img src="tap/tabs_bar.gif" width="32" height="31"><img src="tap/tabs_bar.gif" width="32" height="31"></p>
<p align="center">&nbsp;</p></td>
</tr>
</table>
<form action="insert.phtml">
<table width="401" height="104" border="0" cellpadding="2">
<tr>
<td width="156"><div align="left">
<ul>
<li>IP</li>
</ul>
</div></td>
<td width="202"><input name="Ip" type="text"></td>
</tr>
<tr>
<td><div align="left">
<ul>
<li>Etiqueta</li>
</ul>
</div></td>
<td><input name="Etiqueta" type="text"></td>
</tr>
<tr>
<td><div align="left">
<ul>
<li>Ubicaci&oacute;</li>
</ul>
</div></td>
<td><input name="Ubicacio" type="text"></td>
</tr>
<tr>
<td><ul>
<li>Data d'incid&egrave;ncia </li>
</ul></td>
<td><input name="data" type="text"></td>
</tr>
<tr>
<td><div align="left">
<ul>
<li>Problema</li>
</ul>
</div></td>
<td><input type="text" name="Problema"> </td>
</tr>
</table>
</table>
<p align="center"><a href="incidencias2.php"><img src="tap/but_enviar.gif" width="180" height="39" border="0"></a></p>

<center><INPUT TYPE="submit" NAME="accion" VALUE="Grabar"></cernter>
</FORM>
<hr><br>
<?php
include("conex.phtml");
$link=Conectarse();
$result=mysql_query("select * from incidencies",$link);
?>
<TABLE BORDER=1 CELLSPACING=1 CELLPADDING=1>
<TR>
<TD>&nbsp;<B>IP</B></TD>
<TD>&nbsp;<B>Etiqueta</B></TD>
<TD>&nbsp;<B>Ubicacio</B></TD>
<TD>&nbsp;<B>Fecha</B></TD>
<TD>&nbsp;<B>Problema</B>&nbsp;</TD></TR>
<?php

while($row = mysql_fetch_array($result))
{
printf("<tr>
<td>&nbsp;%s</td>
<td>&nbsp;%s</td>
<td>&nbsp;%s</td>
<td>&nbsp;%s</td>
<td>&nbsp;%s&nbsp;</td></tr>",
$row["ip"], $row["etiqueta"],
$row["ubicacio"],$row["data_incidencia"],$row["problema"]);
}
mysql_free_result($result);
mysql_close($link);
?>
</table>
</body>
</html>


utilizo una libreria q es donde introduzco los datos a la base de datos..


<?php
include("conex.phtml");
$link=Conectarse();
$ip=$_GET['Ip'];
$etiqueta=$_GET['Etiqueta'];
$ubicacio=$_GET['Ubicacio'];
$data_incidencia=$_GET['data'];
$problema=$_GET['Problema'];
mysql_query("insert into incidencies (ip,etiqueta,ubicacio,data_incidencia,problema) values
('$ip','$etiqueta','$ubicacio','$data_incidencia', '$problema')",$link);
header("Location :incidencias2.php");
?>

tamb utilizo el conex.phtml q es para conectarme con la base de datos.

todo esta en el mismo dorectorio...

pero el problema es el hearder.

Gracias Reynier...