[eluser]landitus[/eluser]
I'm trying to do the following: I would like to have 1 view that is used for the form and the form validation and the form success as well. I'm using flashdata to inform the user about the process. But I would like to check wether or not the following code in the view is considered safe and good practice.
I placed this line:
Code:
$this->session->set_flashdata('exito', 'some message');
only to show when the form was saved to the database, so I should be covered right?
form_view.php
Code:
<!-- Flash Data -->
<?php if ($this->session->flashdata('success')) {
echo '<div class="msj success">'.$this->session->flashdata('success').'</div>';
} elseif ($this->session->flashdata('error')) {
echo '<div class="msj error">'.$this->session->flashdata('error').'</div>';
} ?>
<!-- if form was sent succesfull -->
<?php if($this->session->flashdata('success')) :?>
// Thank you message and some information about the next steps to follow...
<?php else :?>
<!-- Render form -->
// Render form
<?php endif :?>