Foro de elhacker.net

Programación => PHP => Mensaje iniciado por: medinadek en 17 Junio 2011, 17:12 pm



Título: NO SE CONECTA CON LA BASE DE DATOS.
Publicado por: medinadek en 17 Junio 2011, 17:12 pm
Buenas tardes, tengo pagina web. Tengo un formulario donde meto usuario y contraseña para entrar a pagina privada. Resulta que cuando estoy en esta ruta:
http://127.0.0.1:8888/principal.html Y escribo usuario y password.
No me deja entrar.
Pero cuando estoy en esta: file:///C:/Program%20Files/EasyPHP-5.3.5.0/www/principal.html Si me deja entrar y todo al pelo.
Mi pregunta es ....¿ por que no se conecta?
Gracias


Título: Re: NO SE CONECTA CON LA BASE DE DATOS.
Publicado por: Pachulero en 17 Junio 2011, 17:31 pm
usas php? pon el codigo fuente y asi te podran ayudar


Título: Re: NO SE CONECTA CON LA BASE DE DATOS.
Publicado por: el-brujo en 17 Junio 2011, 18:15 pm
la ruta file:///C: no está interepretada por el servidor web, estás accediendo diretamente al fichero desde el navegador.

Pon el código fuente o al menos una parte del principal.html


Título: Re: NO SE CONECTA CON LA BASE DE DATOS.
Publicado por: medinadek en 17 Junio 2011, 18:48 pm
la ruta file:///C: no está interepretada por el servidor web, estás accediendo diretamente al fichero desde el navegador.

Pon el código fuente o al menos una parte del principal.html

<html>
<head>
<link rel="stylesheet" type="text/css" href="principal.css" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>HOTELES BENITO </title>

<script type="text/javascript">
/*** Temporary text filler function. Remove when deploying template. ***/
var gibberish=["This is just some filler text", "Welcome to Dynamic Drive CSS Library", "Demo content nothing to read here"]
function filltext(words){
for (var i=0; i<words; i++)
document.write(gibberish[Math.floor(Math.random()*3)]+" ")
}
function compruebax(){
   if ((form1.usuario.value=="") || (form1.passwd.value==""))
      alert("Indroduzca Usuario y Contraseña");
   else   
      form1.submit();
}
</script>

<style type="text/css">
<!--
.Estilo1 {font-size: 10px}
-->
</style>
</head>
<body>
<div id="maincontainer">

<div id="topsection"><div class="innertube">
  <div align="left"><img src="hotel.jpg" width="828" height="251" />  </div>
</div>
</div>
<div class="circlemenu">
<ul>
<li><a href="principal.html"><span>Inicio</span></a></li>
<li><a href="ces.html"><span>CES - V</span></a></li>
<li><a href="lola.html"><span>Casa Lola</span></a></li>
<li><a href="ant.html"><span>Antojito</span></a></li>
</ul>
</div>

<div id="contentwrapper">
<div id="contentcolumn">
<div class="innertube"><b>NOVEDADES</b> <p>Próxima apertura Whiskey Hotel en Murcia ronda norte <P> <img src="hotel1.jpg" width="419" height="251" />
<P> Las obras finalizaron por fin el pasado dia 2 de junio y la inauguracion oficial sera el dia 15 de junio, con la presencia de figuras ilustres como Angelina Jolie y Bratt Pitt
<P><P><P><P><P><P>
<p> Casa Lola recibe galardon al mejor servicio de la region.  <img src="galardon.jpg" width="444" height="158" /> El premio sera entregado este sabado por la ministra de cultura.
<P><P><P>

</div>
</div>
</div>

<div id="leftcolumn">
<div class="innertube"><b>Logg IN</b> </div>
<form id="form1" name="form1" action="logger.php" method="post">
<P> Usuario
<input name="usuario" type="text" />
<P> Contraseña
<input name="passwd" type="password"  />
<P><P>
<center>
     <input type="button" name="loggin" value="Logg In" onClick="compruebax()" />
</center>
</form>
<img src="logo.png" width="150" height="251" />
</div>

<div id="rightcolumn">
<div class="innertube"><b>Publicidad</b><P><P>
<a href="http://www.halconviajes.com/"><img src="halcon.png" width="152" height="80" /></da><P><P><P><P><P><P>
<a href="http://www.viajesiberia.com/"><img src="iberia.jpg" width="152" height="80" /></da><P><P><P><P><P><P>
<a href="http://www.muchoviaje.com/"><img src="muchoviaje.jpg" width="152" height="80" /></da><P><P><P><P><P><P>
<a href="http://www.logitravel.com/"><img src="logitravel.jpg" width="152" height="80" /></da><P><P><P><P><P><P>
<a href="http://destinia.com/"><img src="destinia.jpg" width="152" height="80" /></da><P><P><P><P><P><P>
</div>
</div>

<div class="Estilo3 Estilo1" id="footer"> Copyright &copy; Hoteles Benito S.L. (for itself and on behalf of its corporate group) 1995-2011. All rights reserved. All copyright and other intellectual property rights in all logos, designs, text, images and other materials on this website are owned by  Hoteles Benito S.L. and/or its group companies or appear with permission of the relevant owner (including SNCF).<br>
</div>
</div>
</body>
</html>


Título: Re: NO SE CONECTA CON LA BASE DE DATOS.
Publicado por: medinadek en 17 Junio 2011, 18:50 pm
la ruta file:///C: no está interepretada por el servidor web, estás accediendo diretamente al fichero desde el navegador.

Pon el código fuente o al menos una parte del principal.html

<?php
$con=mysql_connect("127.0.0.1","hotel","123");
mysql_select_db("hoteles", $con);
?>