I want to pass multiple parameters to a function in same controller.Here is my redirect function when i run this code then show warning.
Message: Missing argument 2 for Welcome::sendVerificatinEmail()
redirect('welcome/sendVerificatinEmail/'.$name,$email ,$request_tracking_no);
Try:
redirect('welcome/sendVerificatinEmail/'.$name.'/'.$email.'/'.$request_tracking_no);
Your method:
function sendVerificatinEmail($name, $email, $request_tracking_no){
//...
}
In Codigniter during redirection all post data will destroy and you have to use session variables to send data. try this: I hope help
$data = array('param1'=>'ali','param2'=>55);
// store data to flashdata
$this->session->set_flashdata('data',$data);
// redirect to your controller
redirect('controller/method')
//in other side
$array = $this->session->flashdata('data');
actually Codeigniter uses $_SESSION and you can use directly of sessions instead of flash data like this:
//first
$_SESSION['flash'] = implode('@',array(a,b,c));
//then
$flash = $_SESSION['flash'];
$array = explode('@',$flash);
unset($_SESSION['flash']); //free it
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With