- User/Student Registration Form in PHP and MySQL with Validation
- How to Create Registration Form in PHP and MySQL with Validation
- Step 1 – Create a Database Connection File
- Step 2 – Create a registration form and save data into MySQL database
- Recommended Post
- Conclusion
- How to Create Student Registration System in PHP MySQL
- How To Create Student Registration System
- Creating Database
- Creating Database Connection
- Creating the Form and Send Data into Database using PHP
- Display Data From Database
- Saved searches
- Use saved searches to filter your results more quickly
- License
- technosmarter/student-registration-form-in-php-and-mysql
- Name already in use
- Sign In Required
- Launching GitHub Desktop
- Launching GitHub Desktop
- Launching Xcode
- Launching Visual Studio Code
- Latest commit
- Git stats
- Files
- README.md
- About
User/Student Registration Form in PHP and MySQL with Validation
Simple registration form in PHP and MySQL with validation. In this tutorial, you will learn how to create a user/teacher/student/employee registration in PHP and MySQL with server-side validation.
This tutorial will show you how to implement PHP + MySQL code for registration form with database. And How you can validate and store form data into the MySQL database in PHP. Also, will explain how you can validate data before storing it in the MySQL database.
How to Create Registration Form in PHP and MySQL with Validation
- Step 1 – Create a Database Connection File
- Step 2 – Create a registration form and save data into MySQL database
Step 1 – Create a Database Connection File
In this step, you will create a file name db.php and update the below code into your file.
The below code is used to create a MySQL database connection in PHP. When we insert form data into MySQL database, there we will include this file:
Step 2 – Create a registration form and save data into MySQL database
In this step, you need to create an form and update the below code into your registration form.
Recommended Post
if(!filter_var($email,FILTER_VALIDATE_EMAIL)) < $email_error = "Please Enter Valid Email ID"; >if(strlen($password) < 6) < $password_error = "Password must be minimum of 6 characters"; >if(strlen($mobile) < 10) < $mobile_error = "Mobile number must be minimum of 10 characters"; >if($password != $cpassword) < $cpassword_error = "Password and Confirm Password doesn't match"; >if (!$error) < if(mysqli_query($conn, "INSERT INTO users(name, email, mobile ,password) VALUES('" . $name . "', '" . $email . "', '" . $mobile . "', '" . md5($password) . "')")) < header("location: registration.php"); exit(); >else < echo "Error: " . $sql . "" . mysqli_error($conn); >> mysqli_close($conn); > ?>Please fill all fields in the form
Conclusion
In this registration form in php and mysql with validation tutorial, you have learned how to create a registration form and store data into a MySQL database. Also, you have learned how to validate form data on server side.
This is a very basic and easy example of creating a registration form and store data into a database in PHP. In the next article, we will show you how you can create a login system in PHP and MySQL with form validation.
How to Create Student Registration System in PHP MySQL
Hi in this post i will teach you How to Create a Student registration system in PHP MySQL step by step with Print Function. in this system you can add student information, Print Registered Student info, and search by name, and finally if you want to delete registered student you can delete it . The Student Registration System provides for students the option to register , without the advisor’s prior approval, offered by their colleges during the scheduled registration periods. The students can modify their information selection by adding and/or delete profile. However, when the registration period is over, all previously registered students will be viewable in the system.
How To Create Student Registration System
Creating Database
First we are going to create our Database which store our data.
- Open Phpmyadmin
- Click Database Tab and name it is as “iksk”.
- After creating a Database Click the SQL Tab and paste the below code and then click on Go.
-- phpMyAdmin SQL Dump -- version 4.2.7.1 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Sep 20, 2015 at 03:04 PM -- Server version: 5.6.20 -- PHP Version: 5.5.15 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Database: `iksk` -- -- -------------------------------------------------------- -- -- Table structure for table `admin_login` -- CREATE TABLE IF NOT EXISTS `admin_login` ( `id` int(20) NOT NULL, `user_name` varchar(500) NOT NULL, `password` varchar(500) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ; -- -- Dumping data for table `admin_login` -- INSERT INTO `admin_login` (`id`, `user_name`, `password`) VALUES (1, 'admin', 'admin'); -- -------------------------------------------------------- -- -- Table structure for table `data` -- CREATE TABLE IF NOT EXISTS `data` ( `id` int(11) NOT NULL, `p_y_name` varchar(100) NOT NULL, `p_gender` varchar(100) NOT NULL, `p_dob` varchar(100) NOT NULL, `p_f_name` varchar(500) NOT NULL, `p_nationality` varchar(100) NOT NULL, `p_m_satus` varchar(500) NOT NULL, `p_address` varchar(1000) NOT NULL, `p_e_mail` varchar(200) NOT NULL, `p_a_r_claimed` varchar(100) NOT NULL, `p_edu_quali` varchar(100) NOT NULL, `p_img` varchar(1000) NOT NULL, `p_reg_id` varchar(100) NOT NULL, `p_tra_date` varchar(100) NOT NULL, `p_fee_paid` varchar(100) NOT NULL, `p_agency` varchar(100) NOT NULL, `p_m_payment` varchar(100) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=14 ; -- -- Dumping data for table `data` -- INSERT INTO `data` (`id`, `p_y_name`, `p_gender`, `p_dob`, `p_f_name`, `p_nationality`, `p_m_satus`, `p_address`, `p_e_mail`, `p_a_r_claimed`, `p_edu_quali`, `p_img`, `p_reg_id`, `p_tra_date`, `p_fee_paid`, `p_agency`, `p_m_payment`) VALUES (7, 'Deepak', 'Male', '2015-09-03', 'Rajkumar', 'Indian', 'Unmarried', 'Ballia', 'Deepak.suhawal@gmaiulk.com', '9169371589', '11th', '7.jpg', '1235', '2015-09-10', '1234', '12', '2015-09-23'), (8, 'Manoj', 'male', '2015-09-08', 'B.N. Upapdhaya', 'Indian', 'Unmarried', 'Ballia', 'Deepak.suhawal@gmaiulk.com', '9169371589', 'Ba', 'deepak (3).jpg', '001245', '2015-09-01', '545', '50', '2015-09-25'), (9, 'Deepak Kumar ', 'on', '2015-09-14', 'B.N. Upapdhaya', 'Indian', 'Unmarried', 'Ballia', 'Deepak.suhawal@gmaiulk.com', '9169371589', 'Ba', 'Snapshot_20150901_14.JPG', '001245', '2015-09-15', '545', '12', '2015-09-30'), (10, 'Deepak Kumar ', 'Male', '2015-09-09', 'Rajkumar', 'Indian', 'Unmarried', 'Ballia', 'Deepak.suhawal@gmaiulk.com', '9169371589', '11th', 'Snapshot_20150901_32.JPG', '001245', '2015-09-16', '545', '12', '2015-09-23'), (11, 'Deepak Kumar', 'Male', '1998-10-18', 'Mr. Rajkumar ', 'Indian', 'Unmarried', 'Suhawal Ballia Utter Pradesh', 'Deepak.suhawal@gmaiulk.com', '9169371589', '11th', 'deepak (3).jpg', '001245', '2015-09-16', '545', '12', '2015-09-18'), (12, 'PRIYANSHU RAJ', 'Male', '1999-06-16', 'MR. RAJ KUMAR ', 'INDIAN', 'Unmarried', 'BALLIA', 'DEEPAK.BALLIA@GMAIL.COM', '8545005272', '10TH', 'Deepak (2).jpg', '', '', '25452', '123', '2015-09-30'), (13, 'PRIYANSHU RAJ', 'Male', '1999-07-01', 'Mr. Rajkumar ', 'Indian', 'Unmarried', 'Suhawal Ballia Utter Pradesh', 'deepa.bootcamp@gmail.com', '8545005272', '10TH', 'deepak (3).jpg', '001245', '2015-09-16', '1234', '50', '2015-10-01'); -- -- Indexes for dumped tables -- -- -- Indexes for table `admin_login` -- ALTER TABLE `admin_login` ADD PRIMARY KEY (`id`); -- -- Indexes for table `data` -- ALTER TABLE `data` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `admin_login` -- ALTER TABLE `admin_login` MODIFY `id` int(20) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `data` -- ALTER TABLE `data` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=14; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
Creating Database Connection
next step is to create a database connection and save it is as “connect.php”. This form is used to connect our form to Database.
Creating the Form and Send Data into Database using PHP
Next step is create a form and save it is as “index.php”. and we are validating form using php to send data into database.
else < ?>alert('Any of the fields is Empty ')"; > else < if($image_type=="image/jpeg" or $image_type=="image/png" or $image_type="image/gif") < if($image_size<=500000) < move_uploaded_file($image_tmp,"images/$image_name"); >else < echo ""; > > else < echo ""; > $query= "insert into data (p_y_name,p_gender,p_dob,p_f_name,p_nationality,p_m_satus,p_address,p_e_mail,p_a_r_claimed,p_edu_quali,p_img,p_reg_id,p_tra_date,p_fee_paid,p_agency,p_m_payment) values('$post_y_name','$post_gender','$post_dob','$post_f_name','$post_nationality','$post_m_satus','$post_address','$post_e_mail','$post_a_r_claimed','$post_edu_quali','$image_name','$post_reg_id','$post_tra_date','$post_fee_paid','$post_agency','$post_m_payment')"; if(mysql_query($query)) < echo ""; > else < echo ""; > > > > ?>
Display Data From Database
in this step retrieve inserted data from database in a page copy the below code and save it is as “displaypage.php”.
else < ?>?>
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
Create student registration form in PHP with MYSQL database. Student registration form with printable preview in PHP, bootstrap and MYSQL database.
License
technosmarter/student-registration-form-in-php-and-mysql
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
Student registration form with printable preview in PHP with MYSQL database
Create student registration form in PHP with MYSQL database. Student registration form with printable preview in PHP, bootstrap and MYSQL database. The student registration form is used to get information from the students. Various schools or colleges are using the student registration form. The registration form is known as the student admission form. Any student can complete their admission using this admission form. You can create a student registration form in PHP with the MYSQL database.
Students can register with the registration form and print the form and save it as a pdf. Students can make a hard copy of the form or save it as a PDF. This is a complete admission form with printable form in PHP, MYSQL with bootstrap. As you know, bootstrap is one of the best framework that is used to make responsive registration form.
After registering, the user redirects to the preview page. A student can check the complete details on the preview page. After that, the student can print this page or save it as PDF on local computer for future reference.
How to install student registration form in PHP and MYSQL —
First, you will need a complete zip file for the student registration form. You can watch the demo and download the student registration system from here.
Student registration form in PHP and MYSQL | Source Code Get the complete source code in a zip file for the student registration form.
Compress the zip file and find the database table in the database folder.
Create a database.
Import the database from the database folder .
Edit the config.php file and set your connection credentials.
Execute the code and enjoy the registration form in PHP with the MYSQL database.
About
Create student registration form in PHP with MYSQL database. Student registration form with printable preview in PHP, bootstrap and MYSQL database.