EllisLab text mark
Advanced Search
     
The connection to the server was reset while the page was loading
Posted: 09 November 2012 07:37 AM   [ Ignore ]
Joined: 2011-03-11
79 posts

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

/*     * **************************** 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'$Dheadertrue);     
        
$this->template->write_view('content''empregos/empregos_listar_myjobs_delete'$Ddatatrue);
        
$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

<?php

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


        <
table>

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

    
<?php } ?> 


now iam going to show the model

/*************************** 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

/** ************* 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

 

 
Posted: 09 November 2012 12:00 PM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Joined: 2010-11-26
7 posts

Hi,
Try it in your console:

sudo a2enmod rewrite 
sudo apache2 restart 

 

 
Posted: 09 November 2012 12:10 PM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Joined: 2011-03-11
79 posts

i changed the name of the function from listar_my_jobs_delete
to

function listarmydelete() 

and know its working

don’t ask me why

thanks