07.03.2016 Views

helloooo

fjfjfjsjdf

fjfjfjsjdf

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

12. Form Validation<br />

CodeIgniter<br />

Validation is an important process while building web application. It ensures that the<br />

data that we are getting is proper and valid to store or process. CodeIgniter has made<br />

this task very easy. Let us understand this process with a simple example.<br />

Example<br />

Create a view file myform.php and save the below code it in<br />

application/views/myform.php. This page will display form where user can submit<br />

his name and we will validate this page to ensure that it should not be empty while<br />

submitting.<br />

<br />

<br />

My Form<br />

<br />

<br />

<br />

<br />

<br />

Name<br />

<br />

<br />

<br />

<br />

<br />

Create a view file formsuccess.php and save it in<br />

application/views/formsuccess.php. This page will be displayed if the form is<br />

validated successfully.<br />

<br />

<br />

49

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!