Welcome Guest, Not a member yet? Register   Sign In
The connection to the server was reset while the page was loading
#1

[eluser]dinisptc[/eluser]
the website works fine on my local machine when i upload it to the webhosting i have this error only on one function

this is the error :

The connection was reset

The connection to the server was reset while the page was loading

i am going to show the controller

Code:
/*     * **************************** LISTAR MY Jobs DELETE *************************** */

    function listar_my_jobs_delete() {


      if (!$this->ion_auth->logged_in())
      {
   //redirect them to the login page


   redirect('user/login', 'refresh');
      }
      else
      {

   // get the user object      
   $data->the_user = $this->ion_auth->user()->row();
              // put the user object in class wide property--->---->-----
              $this->the_user = $data->the_user;
            
              // load $the_user in all displayed views automatically
              $this->load->vars($data);
                  
        /* initial data */
        $Ddata['page_details'] = array('page_title' => 'List Jobs');
        $Dheader = array();
        $DContent['page_details'] = array('page_title' => 'Index of freejoBoard');
        $Dsidebar = array();
        $Dfooter = array();  
    
  

        /* Pagination  data */    
        $config['base_url'] = site_url("empregos/listar_my_jobs_delete/");        
        $config['total_rows'] = count($this->empregos_model->find_by_identidate($this->session->userdata('user_id')));
$config['uri_segment'] = 3;
        $config['per_page'] = 10;

        $this->pagination->initialize($config);

        $Ddata['empregos']=$this->empregos_model->listar_myjobs($config['per_page'],$this->uri->segment(3,0));  
    



        /* carregar o template */        
        $this->template->write_view('header', 'html/header', $Dheader, true);    
        $this->template->write_view('content', 'empregos/empregos_listar_myjobs_delete', $Ddata, true);
        $this->template->write_view('sidebar', 'html/sidebar_user');
        $this->template->write_view('footer', 'html/footer');
  
        $this->template->render();
      }//else


    }


now i am going to show the view

Code:
<?php

    if (isset($empregos) && is_array($empregos)) {
?>
        <h3>Delete Job</h3>
        <br/>
        <br/>


        <table>

        <tbody>
        <tr>
        &lt;?php foreach ($empregos as $row) { ?&gt;              
        &lt;?php echo anchor('empregos/apagar/' . $row['id'],$row['titulo']);?&gt;
<br/>
        &lt;?php echo "Company :".$row['nome_empresa']; ?&gt;
        &lt;?php echo "Ad Date :".$row['data_criacao']; ?&gt;
        &lt;?php echo "Work Location :".$row['local_de_trabalho']; ?&gt;            
        <br/>
        &lt;?php echo anchor('empregos/apagar/' . $row['id'],'Delete');?&gt;
        <br/>
        <br/>
        &lt;?php } ?&gt;
</tr>
&lt;?php
echo $this->pagination->create_links();?&gt;
            </tbody>
        </table>

    &lt;?php } ?&gt;


now iam going to show the model

Code:
/*************************** listar_myjobs ************************************************/
/******************* Esta função é usada na pagina de listar ******************************/
/******************************************************************************************/

    function listar_myjobs($limit,$offset){
        $result=false;
                
      
    
$this->db->from('empregos');

        $this->db->limit($limit, $offset);

$this->db->where('identidade',$this->session->userdata('user_id'));

        $this->db->order_by('empregos.data_criacao', 'DESC');

$query = $this->db->get();

        if ($query->num_rows() > 0) {
            foreach ($query->result_array() as $row) {
                $result[] = $row;
            }
        }
        return $result;
    }

and
Code:
/** ************* find_by_id *************** **/


    function find_by_identidate($imovel_id) {
        

        
        $this->db->order_by('empregos.data_criacao', 'DESC');

$this->db->from('empregos');
$this->db->where('identidade',$imovel_id);

        $query = $this->db->get();

        if ($query->num_rows() > 0) {
            foreach ($query->result_array() as $row) {
                $result[] = $row;
            }
        } else {
            $result = false;
        }


        return $result;

    }


now iam going to show the php configuration on the webhosting

Resource Limits max_execution_time 30
Resource Limits max_input_time 60
Resource Limits memory_limit 512M
Data Handling register_globals You should do your best to write your scripts so that they do not require register_globals to be on; Using form variables as globals can easily lead to possible security problems, if the code is not very well thought of. Off

Language Options safe_mode Off

#2

[eluser]robertorubioes[/eluser]
Hi,
Try it in your console:

Code:
sudo a2enmod rewrite
Code:
sudo apache2 restart

#3

[eluser]dinisptc[/eluser]

i changed the name of the function from listar_my_jobs_delete
to
Code:
function listarmydelete() {

and know its working

don't ask me why

thanks




Theme © iAndrew 2016 - Forum software by © MyBB