So this is my code so far. I'm new in programming in php so I was trying my best to make a register form that checks if the inputs exists in dummyclients_table in my database and if it exists it will insert the inputs into clients_table. Anyone who knows php can help me with this?
The process in the registration should be input>check if existing in a table in database>insert data if existing.
We are required to have a dummy table for security purposes because it is our school's system someday. We can't allow other people to just register in this system. It is exclusive for the students in our school only.
<?php
session_start();
if(isset($_SESSION['clients_tbl'])!="")
{
header("Location: homethesis.php");
}
include_once 'dbconnect.php';
if(isset($_POST['btn-signup']))
{
$id_number = $_POST['id_number'];
$lname = $_POST['lname'];
$fname =$_POST['fname'];
$mname =$_POST['mname'];
$contact_number =$_POST['contact_number'];
$password =$_POST['password'];
$course =$_POST['course'];
$college =$_POST['college'];
$check = mysql_query("SELECT * FROM dummyclients_tbl WHERE student_number='$id_number' AND student_lname='$lname'");
I temporarily used this condition to see if my code is really working
if(mysql_num_rows($check)==0){
?>
<script>alert('Match Found');</script>
<?php
}
else{
?>
<script>alert('Nothing Found');</script>
<?php
}
}
?>