O'Reilly logo

Building a Web Application with PHP and MariaDB: A Reference Guide by Sai Srinivas Sriparasa

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding a student

In this section, we will build our first view that will allow us to add a student to our course_registry database. While working with MVC, every action in a controller should have a separate view. As there can be one or more actions in a controller, we will create a students subdirectory in the views directory. Once we start working on the courses controller, we will create another subdirectory in the views directory for storing the views for the courses controller and add the folloing code in the views/students/add.php file:

<div id="addStudent"> <?php if(isset($this->id)){ echo "New user has been successfully added"; } ?> <form class="Frm" action="add" method="post"> <ul> <li> <label>First Name</label> <input name="first_name" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required