PHP site 1 5/1/2017


SUBMITTED BY: canonical

DATE: May 2, 2017, 1 a.m.

FORMAT: PHP

SIZE: 1.0 kB

HITS: 283

  1. If you want more of my pastes visit: https://randompaste.000webhostapp.com/index.html
  2. --------------------------------------------------------------------------------------
  3. <?php
  4. session_start();
  5. include('login.php');
  6. if (isset($_SESSION['correo'])) {
  7. header("Location: /proyecto/micuenta/index.php");
  8. } else {
  9. }
  10. ?>
  11. <?php
  12. session_start();
  13. $correo = $_POST["correo"];
  14. $password = $_POST ["password"];
  15. $conexion = mysql_connect("localhost","root","oliver0303");
  16. mysql_select_db("biciusers",$conexion);
  17. $password = md5($password);
  18. $sql="SELECT id FROM registro WHERE correo = '$correo' AND contraseƱa ='$password'";
  19. $comprobar = mysql_query($sql);
  20. session_start();
  21. if (mysql_num_rows($comprobar) > 0){
  22. $_SESSION['correo'] = $row['correo'];
  23. $id = mysql_result($comprobar,0);
  24. $row=mysql_fetch_array($comprobar);
  25. echo '<script> window.location="/proyecto/micuenta/index.php"; </script>';
  26. }else {
  27. echo "usuario o contrasena invalida";
  28. }
  29. ?>

comments powered by Disqus