internetprogrammierung/php/login.php

23 lines
573 B
PHP
Raw Normal View History

2018-06-07 21:55:32 +02:00
<?php
2018-06-08 17:29:14 +02:00
require('../dbConnect.php');
2018-06-07 21:55:32 +02:00
2018-06-08 17:29:14 +02:00
$name = $database->real_escape_string($_POST['registerName']);
$pswd = $database->real_escape_string($_POST['registerPassword']);
$email = $database->real_escape_string($_POST['registerMail']);
2018-06-07 21:55:32 +02:00
2018-06-08 17:29:14 +02:00
$abfrage = "SELECT password WHERE $name=user";
2018-06-07 21:55:32 +02:00
if ($pswd == $abfrage) {
// code..
2018-06-08 17:29:14 +02:00
echo "HI";
2018-06-07 21:55:32 +02:00
}
2018-06-08 17:29:14 +02:00
// if ($abfrage == "") {
$stmt = $database->prepare("INSERT INTO user(user, email, password) VALUES (?,?,?)");
$stmt->bind_param("sss", $name, $email, $pswd);
$stmt->execute();
$stmt->close();
// }
2018-06-07 21:55:32 +02:00
?>