0% found this document useful (0 votes)
6 views5 pages

Student Registration Form Guide

The document is an HTML page for a student registration form that includes a JavaScript function to validate user input for required fields such as Registration ID, Username, Address, and Email. It connects to a MySQL database to check for duplicate entries and insert new records upon form submission. The form is styled with CSS and structured using a table layout.

Uploaded by

alhajji215
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views5 pages

Student Registration Form Guide

The document is an HTML page for a student registration form that includes a JavaScript function to validate user input for required fields such as Registration ID, Username, Address, and Email. It connects to a MySQL database to check for duplicate entries and insert new records upon form submission. The form is styled with CSS and structured using a table layout.

Uploaded by

alhajji215
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

<html>

<html>

<head>

<title>Student Registration</title>

<style>

table {

border-collapse: collapse;

table, th, td {

border: 2px solid black;

</style>

</head>

<body>
<script>

function validateForm() {

var id = [Link]('r').[Link]();

var user = [Link]('u').[Link]();

var address = [Link]('a').[Link]();

var email = [Link]('e').[Link]();

if (id === "") {

alert("Registration ID is required.");

return false;

if (user === "") {

alert("Username is required.");

return false;

if (address === "") {

alert("Address is required.");

return false;

if (email === "") {

alert("Email address is required.");

return false;

return true;
}

</script>

<?php

$con = mysqli_connect("localhost", "root", "" "madu");

if(isset($_POST["submit"])){

$id = $_POST["ID"];

$username = $_POST["user"];

$address = $_POST["address"];

$email= $_POST["email"];

$s="SELEECT id FROM com225 WHERE id='$id' ";

$avoid_dublicate = mysqli_query($link,$s);

$count = mysqli_num_rows($avoid_dublecate);

if($count>0){

echo"Please Sorry This Record Already Captured"

return false;

$sql ="INSERT INTO com225() VALUES ('$id','$user','$address','$email')";

$result = mysqli_query($link,$sql);
if($sql){

echo"success";

?>

<form action="POST" ="" onsubmit="return validateForm()">

<table>

<tr>

<th colspan="2">Life Shopping</th>

</tr>

<tr>

<td>ID:</td>

<td><input type="text" name="reg" id="r"></td>

</tr>

<tr>

<td>USERNAME:</td>

<td><input type="text" name="user" id="u"></td>

</tr>

<tr>

<td>ADDRESS:</td>

<td><input type="text" name="address" id="a"></td>

</tr>

<tr>
<td>EMAIL:</td>

<td><input type="text" name="email" id="e"></td>

</tr>

<tr>

<th colspan="2"><button type="submit">Submit</button></th>

</tr>

</table>

</form>

</body>

</html>

You might also like