Max45 Posted March 28, 2020 Share Posted March 28, 2020 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. Quote Link to comment Share on other sites More sharing options...
benanamen Posted March 28, 2020 Share Posted March 28, 2020 (edited) OP was already advised about his code on another forum and did not implement any of the advice whatsoever. His response was "Could you please write it to me". OP, we are not a coding on demand service. You apparently didn't even attempt to copy and paste the complete working example from the tutorial you were referred to. If you just want someone to write it for you then post a job offer on any of the forums jobs section. Edited March 28, 2020 by benanamen Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.