Welcome Guest, Not a member yet? Register   Sign In
Blank page after reloading
#1

[eluser]Linkark07[/eluser]
Good afternoon.

I have been having a particular problem after doing a submit: if I try to reload the page (f5), instead of reappearing, I get a blank page.

An example: I have a dropwdown which sends the user to another page; this page depends on the choice of the user. In the next page, if the user clicks refresh or presses f5, a blank page appears.

Likewise, if the user clicks the back button for return to the dropwdown and chooses another option, instead of loading the correct page, the blank page appears.

Some of the code here:

Dropdown

Code:
div id="content">

<?php
$attributes = array('class' => 'bootstrap-frm',
    'name' => 'formulario',
    'id' => 'formulario');
?>
            <?=form_open(base_url().'site/buscarcurso', $attributes)?>
              <label>Curso</label><select class="cursos" id="cursos" name="cursos"><p>&lt;?=form_error('cursos')?&gt;</p>
              </br>
            &lt;?php

            foreach($grupos as $row)
            {
              echo '<option value="'.$row->nombre.'">'.$row->nombre.'</option>';
            }
            ?&gt;
            </select><p></p>
            
              &lt;input type="hidden" name="id" readonly/&gt;&lt;p>
              
              &lt;input type="hidden" name="token" value="&lt;?=$token?&gt;" /&gt;
              &lt;input type="submit" name="submit" value="Confirmar Datos" /&gt;
            
               &lt;?=form_close()?&gt;

Controller:
Receives the post value.
Code:
public function buscarcurso(){
     if($this->input->post('token') && $this->input->post('token') == $this->session->userdata('token'))
    {
               $this->form_validation->set_rules('cursos', 'Cursos', 'trim|xss_clean');
             //   $this->form_validation->set_message('required', 'Se requiere que elija un curso');
                if($this->form_validation->run() == FALSE)
                {
                    $this->inscribir();
                }else{
                    $nombre = $this->input->post('cursos', TRUE);
              
                 //   $this->load->view("prueba", $info);
                  
                  
             $buscanombre = $this->curso_model->obtenerdatosgrupo($nombre);
             // $this->session->set_flashdata('nombre', $nombre);
              //  redirect(base_url().'site/confirma_inscr');  
                    $this->confirma_inscr($nombre);
                        
                     return $nombre;
                }
       }
  }
The page that brings a blank page if reloaded
Code:
public function confirma_inscr($nombre){ //Esta página es para confirmar la inscripción. El parámetro viene de la función buscarcurso();
      if($this->session->userdata('is_logued_in')){

       $data['titulo'] = 'Confirmar Inscripción';
       $data['query'] = $this->curso_model->obtenerdatosgrupo($nombre);
       //Ahora trae más columnas de la tabla curso.

    $data['token'] = $this->token();
  
    $this->load->view("site_header", $data);
      $this->load->view("site_navon");
    $this->load->view('Estudiante/confirmarcurso_view', $data);  
      $this->load->view("site_footer");
      }else{
         $this->not_logged();
      }
  }

I have noted that on the browser, instead of appearing confirma_inscr when the page is loaded for the first time, the function buscarcurso appears. Is that a cause of the problem?

Thanks in advance.

Edit: This also happens when a form validation fails and then I submit with the correct values the form requires. The blank page appears.


Messages In This Thread
Blank page after reloading - by El Forum - 09-19-2014, 01:55 PM
Blank page after reloading - by El Forum - 09-19-2014, 04:09 PM
Blank page after reloading - by El Forum - 09-19-2014, 04:26 PM
Blank page after reloading - by El Forum - 09-20-2014, 05:09 AM
Blank page after reloading - by El Forum - 09-20-2014, 05:44 AM
Blank page after reloading - by El Forum - 09-20-2014, 03:05 PM



Theme © iAndrew 2016 - Forum software by © MyBB