PHP Scrit in C.I Method - Convertion |
Hello Guys,
Can someone please help me to convert this procedural php script in the C.I method? I would be immensely grateful I'm trying, but i'm doing something wrong. Thank you in advance. This is the procedural script PHP: Code: <?php This is the html Form: Code: <form action = "u_ifelse1.php" method = "post"> Now there comes my try - 1° CI_Controller: Code: class U_ifelse1 extends CI_Controller{ 2° The form - home_23.php Code: <body> 3° - Third file home_24.php Code: <body>
@Porto,
Maybe these links will help you... https://codeigniter.com/user_guide/libra...n-tutorial https://codeigniter.com/user_guide/tutor...l#tutorial
Give all your inputs names, including the submit button. You can use the name "submit".
Your controller should load the form view only if "submit" wasn't posted. The common logic for a function like that is: PHP Code: if (! $this->input->post('submit')) { The line PHP Code: if ($Form_data['form_fields'] == "N" ) doesn't make sense, because $form_data['form_fields'] is an array with all post values. To determine if $sorte == "N", do this: PHP Code: if ( $this->input->post('sorte') == 'N') { |
Welcome Guest, Not a member yet? Register Sign In |