i am creating a php/mysql registration form with email verification, the code works well on my local server and does nothing while uploaded on Cpanel.
<?php
include ('connection.php');
if(isset($_POST['submitform'])){
$name = trim(mysql_escape_string($_POST['name']));
$email = trim(mysql_escape_string($_POST['email']));
$passwords = trim(mysql_escape_string($_POST['pwd']));
$password = md5($passwords);
$query_verify_email = "SELECT * FROM register WHERE email ='$email' and isactive = 1";
$result_verify_email = mysqli_query($con,$query_verify_email);
if (!$result_verify_email) {
echo ' Syste Error! ';
}
if (mysqli_num_rows($result_verify_email) == 0) {
$hash = md5(uniqid(rand(), true))
Though i can connect to the database, it seems like it's not inserting any data to the database
$query_create_user = "INSERT INTO `register` ( `name`, `email`, `password`, `hash`) VALUES ( '$name', '$email', '$password', '$hash')";
$result_create_user = mysqli_query($con,$query_create_user);
if (!$result_create_user) {
echo 'Query Failed ';
}
if (mysqli_affected_rows($con) == 1) {
This is where it should verify and send the email, and echo the message that verification code has been send or else echo the errors. My main problem is that it cannot insert data into the database