Mysql
 sql >> Teknologi Basis Data >  >> RDS >> Mysql

URL salah saat menjalankan kueri mysql (tidak mengikuti instruksi lokasi header php)

Saya harap ini membantu, saya telah menulis halaman web yang menggunakan lokasi tajuk. Mungkin Anda dapat melihat apakah Anda melakukan sesuatu yang salah:

    <html>
<head>
<link rel="stylesheet" type="text/css" href="./static/css/mobile-login.css">
<!-- <link rel="stylesheet" type="text/css" href="./static/css/mobile.css"> -->

<script>
function goBack()
{
window.history.back()
}
</script>

<title>Register | Mobile</title>
</head>
<body background="../images/mobile/login-bkg.jpg">
<center>
<a href="https://localhost/m/">
<img src="../static/images/logo.png">
</a>
</center>
<div id="login-panel" class="panel">
<div class="panel-container">

<?php
// Create connection
$con=mysqli_connect("localhost","root","","twitter");

// Check connection
if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }

        $email      = isset($_POST['email'])?( strtolower(trim($_POST['email'])) ):'';
    $fullname   = isset($_POST['name'])?(trim($_POST['name'])):'';
    $username   = isset($_POST['username'])?(trim($_POST['username'])):'';
    $password2  = isset($_POST['password2'])?(trim($_POST['password2'])):'';
    $password   = isset($_POST['password'])?(trim($_POST['password'])):'';
        $accept_terms   = isset($_POST['accept_terms'])&&$_POST['accept_terms']==1;

    // Check for duplicate entries
    $result = mysqli_query($con, "SELECT  * FROM users WHERE email='$email'");
    if($result) {
        echo 'That email was already used';
        echo '<strong> <button onclick="goBack()">Go back</button></strong><br>';
    }

    // handle the error of the passwords not matching
    if ($password != $password2){
    echo 'Passwords did not match. Go back and try again, <a href="https://localhost/mobile_register.php">return</a>';
}else{
$sql="INSERT INTO users (fullname, username, email, password)
VALUES
('".$fullname."','".$username."','".$email."',MD5('".$password."'))";

if (!mysqli_query($con,$sql))
  {
  die('Error: ' . mysqli_error($con));
  }
echo "You are now registered<br>";
echo "<a href='http://localhost/m/'>Login</a>";
}
mysqli_close($con);
header("Location:http://localhost/m/");
?>
</div>
</div>
<div class="clear"></div>
</body>
</html>



  1. Database
  2.   
  3. Mysql
  4.   
  5. Oracle
  6.   
  7. Sqlserver
  8.   
  9. PostgreSQL
  10.   
  11. Access
  12.   
  13. SQLite
  14.   
  15. MariaDB
  1. Bagaimana cara mengubah tabel SQL 500GB menjadi Apache Parket?

  2. SQL Query Untuk Membuat Database Di MySQL

  3. CONVERT_TZ – Cara Mengubah Zona Waktu MySQL di Query

  4. Cara Menyisipkan Beberapa Baris di MySQL

  5. Penghitung Tampilan SQL PHP menggunakan PDO prepare()