Answer the question
In order to leave comments, you need to log in
Why can't I output function in function, php?
Hello
Is it possible in php to call a function inside another function, here is the code
public function redactpost($id) {
if($this->session->userdata('logged_in'))
{
$session_data = $this->session->userdata('logged_in');
$this->load->model('info_site');
$data =$this->info_site->get_info_post($id);
//print_r ($data);
$inFo ['Titlu'] = $data[0]['Titlu'];
$inFo ['PozaDeTitlu'] = $data[0]['PozaDeTitlu'];
$inFo ['Autorul'] = $data[0]['Autorul'];
$inFo ['Data'] = $data[0]['Data'];
$inFo ['Stirea'] = $data[0]['Stirea'];
$inFo ['id'] = $data[0]['id'];
$this->load->view('redactpost', $inFo);
}
else
{
//If no session, redirect to login page
redirect('login', 'refresh');
}
}
public function redactnew ($id) {
if($this->session->userdata('logged_in'))
{
$session_data = $this->session->userdata('logged_in');
$this->load->model('info_site');
$dk['Titlu'] = $this->input->post('titlu');
$dk['PozaDeTitlu'] = $this->input->post('linkPozaPrincipala');
$dk['Autorul'] = $this->input->post('NamePub');
$dk['Data'] = $this->input->post('data');
$dk['Stirea'] = $this->input->post('noutatea');
$dm['id'] = $id;
$this->info_site->edit_db_blog($dk,$id);
redactpost($id);
}
else
{
//If no session, redirect to login page
redirect('login', 'refresh');
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question