I have created a simple mysql database with php code and I put it on server using on server phpmyadmin .
I added an insert button and everything was ok.But then the code stop working without no reason.
Here the URL of my database site: mathcalc.appleschat.com
Here the insertion code
<?php
include "connectToDB.php";
function mksafe($data){
$data=trim($data);
$data=strip_tags($data);
$data=htmlspecialchars($data);
$data=addslashes( $data);
return $data
}
$value1 = mksafe($_POST['fname']);
$value2 = mksafe($_POST['lname']);
$value3 = mksafe($_POST['email']);
$date = date('Y-m-d');
$sql = "INSERT INTO users (firstname, lastname, email,reg_date)
values( '$value1', '$value2', '$value3','$date')";
if ($conn->query($sql) === TRUE) {
header("Refresh:0; url=index.php");
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
?>
Thanks in advance any help will be appreciated.