<script type="text/javascript">
function signup() {
var url = "process/sign-up-process.php?" + $("#signup-form").serialize();
// alert(url);
$.get(url, function (data, status) {
alert(data);
});
}
</script>
Page: process/sign-up-process.php code goes below
<?php
require_once('connection.php');
$full_name = filter_input(INPUT_GET, 'full_name', FILTER_SANITIZE_STRING);
$email = $_GET['email'];
$email = filter_var($email, FILTER_VALIDATE_EMAIL);
$user_password = filter_input(INPUT_GET, 'user_password', FILTER_SANITIZE_STRING);
$query = "INSERT INTO registered_users_list (full_name, email, user_password) VALUES ('$full_name', '$email', '$user_password')";
$query1 = mysqli_query($conn, $query);
$count = mysqli_affected_rows($conn);
if($count == 1){
echo "Signed up";
}else{
echo "Sorry";
}
?>
The problem is in "process/sign-up-process.php" page, when I comment out the query code and
echo "Some Random Text"
then the
alert(data)
works. But when I tried to run INSERT query it doesn't work. I think the error must be in PHP improved i.e mysqli string.