Fatal error: Cannot redeclare conectarse() (previously declared in C:\AppServ\www\Xnotas\clases\conexion.class.php:4) in C:\AppServ\www\Xnotas\clases\conexion.class.php on line 15
reviso mi clase para la conexion y no le veo el error en ningun lado:
Código:
<?php function conectarse() { if(!($link=mysql_connect("127.0.0.1","root","123"))) { echo "error de conexion"; exit(); } if(!mysql_select_db("antarum",$link)) { echo("error de base de datos"); exit(); } return $link; } $link=conectarse(); ?>
y la pagina que me tira el error tiene el siguiente codigo:
Código:
<?php require('clases/conexion.class.php'); $sql="INSERT INTO horas (inicio) VALUES (NOW())"; mysql_query($sql,$link); ?> <html> <head> <title>Datos</title> <div align="right"> <a href="javascript:Abrir_ventana('final.php')" onClick="confirmar()"><font size="1" face="Verdana"><img src="img/termino.png" width="174" height="38"></a> </div> </head> <body onload="asignaVariables();"> <link rel="stylesheet" type="text/css" href="buscar.css"> <script type="text/javascript" src="buscar.js"></script> <script language="JavaScript"> function Abrir_ventana (pagina) { var opciones="toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes, width=508, height=300, top=85, left=140, Text-align=left"; window.open(pagina,"",opciones); } </script> <script type="text/javascript"> setActiveStyleSheet(document.getElementById("defaultTheme"), "Aqua"); </script> <script type="text/javascript"> function formReset() { document.getElementById("form1").reset(); } </script> <script> function confirmar2() { if(confirm('¿Esta seguro de terminar la atención?')) { formReset() } else { return false; } } </script> <?php include('clases/conexion.class.php'); $result=mysql_query("select emp_rut, emp_dir, emp_fono, emp_mail, equi_pass where emp_nom=$txtnom",$link); $nu=mysql_num_rows($result); if($nu==0){ echo"no tiene resultado"; } else{ $row=mysql_fetch_array($result); echo"<form method=GET action='datos.php'>"; echo"<input type='text' name='codigo' value=$row[0]>","<br>"; echo"<input type='text' name='procesador' value=$row[1]>","<br>"; echo"<input type='text' name='ram' value=$row[2]>","<br>"; echo"<input type='text' name='disco' value=$row[3]>","<br>"; echo"<input type='text' name='pass' value=$row[4]>","<br>"; echo"<input type='text' name='sistema' value=$row[5]>","<br>"; echo"<input type='text' name='desc' value=$row[6]>","<br>"; echo"</form>"; } mysql_close($link); ?> <form name="form2" method="post" action=""> <label></label> </form> <form id="form1" name="form1" method="post"> <h2 align="center" style="font:'Times New Roman', Times, serif">Bienvenido al sistema de atenciones</h2> <table border="1" align="center"> <tr> <td><div align="center">Nombre</div></td> <td width="230" height="20"><div id="demo"> <input type="text" id="input_2" class="input" nfocus="if(document.getElementById('lista').childNodes[0]!=null && this.value!='') { filtraLista(this.value); formateaLista(this.value); reiniciaSeleccion(); document.getElementById('lista').style.display='block'; }" onblur="if(v==1) document.getElementById('lista').style.display='none';" onkeyup="if(navegaTeclado(event)==1) { clearTimeout(ultimoIdentificador); ultimoIdentificador=setTimeout('rellenaLista()', 1000); }" size="25"><input type="button" name="btnok" value="ok" onclick="consultar()"></div> <div id="lista" onmouseout="v=1;" onmouseover="v=0;"></div> </div> </td> <td><div align="center">Rut</div></td> <td> <input name="txtrut" type="text" id="txtrut" size="40"/> <td><div align="center">Consultante</div></td> <div id="demo"> <td><input type="text" name="consultante" size="20"> <div id="lista" onmouseout="v=1;" onmouseover="v=0;"></div> </div> <td width="42"><div align="center"> <a href="javascript:Abrir_ventana('consultante.php')"><font size="1" face="Verdana"><img src="img/add.png" width="16" height="16"><a href="consultante.php"></a> </div></td> <tr> <td><div align="center">Telefono</div></td> <td> <input name="txtfono" type="text" id="txtfono" size="25"/> </td> <td><div align="center">Ciudad</div></td> <td> <input name="txtciu" type="text" id="txtciu" size="40"/> </td> <td><div align="center">Correo</div></td> <td><input type="text" name="textfield6" /></td> <tr> <td> Observaciones </td> <td> <textarea name="descripcion"></textarea> </td> <td>Estado atención</td> <td><input type="radio" name="estado" value="pendiente">Pendiente<input type="radio" name="estado" value="solucionado">Solucionado <input type="radio" name="estado" value="terreno">Terreno</td> </tr> </tr> </table> <a href="busqueda.php"></a> <br> <h3 align="center" style="font-size:32px" style="font:'Times New Roman', Times, serif">Equipos</h3> <h5 align="center"><a href="formulario_gravar.php" target="blank"><img src="img/guardar.png" title="Agregar equipo"></a></h5> <?php include('clases/conexion.class.php'); $result=mysql_query("select equi_cod,equi_proce,equi_ram,equi_disco,equi_pass,equi_desc,sis_nom from equipos inner join sistemas_operativos on equipos.sis_cod=sistemas_operativos.sis_cod order By equi_cod",$link); $nu=mysql_num_rows($result); if($nu==0){ echo"no tiene resultado"; } else{ $numero_campos=mysql_num_fields($result); } $mostrar=""; $mostrar.="<link href='archivo.css'rel ='stylesheet' type='text/css'>"; $mostrar.="<table align='center'>"; //nombre de campos en fila de tabla $mostrar.="<tr>"; $mostrar.="<td>Borrar</td>"; $mostrar.="<td>Editar</td>"; $mostrar.="<td>Código equipo</td>"; $mostrar.="<td>Procesador</td>"; $mostrar.="<td>RAM</td>"; $mostrar.="<td>Disco duro</td>"; $mostrar.="<td>Password</td>"; $mostrar.="<td>Descripción</td>"; $mostrar.="<td>Sistema operativo</td>"; for($nc==0;$nc<$numero_campos;$nc++) { $ncampo=mysql_field_name($result,$nc); $mostrar.="<td>"; $mostrar.="</td>"; } $mostrar.="</tr>"; while($row=mysql_fetch_array($result)) { $mostrar.="<tr bgcolor='#AAAAAA'>"; $mostrar.="<td><a href='borrar.php?id=$row[0]'><img src='img/eliminar.png'></a></td>"; $mostrar.="<td><a href='modificar.php?id=$row[0]'><img src='img/editar.png'></a></td>"; for($n=0;$n<$numero_campos;$n++) { $mostrar.="<td>"; $mostrar.=$row[$n]; $mostrar.="</td>"; } } $mostrar.="</tr></table>"; $mostrar.="</div>"; echo $mostrar; ?> </form> </body> </html>
espero que me puedan orientar un poco para saber que es lo que tengo ue modificar...
desde ya muchas gracias