Welcome Guest, Not a member yet? Register   Sign In
get method doesn't work properly
#1

[eluser]mazzy[/eluser]
this is my code in the view:


Code:
<form action="<?php echo site_url("search/send_mail?uid=$id"); ?>" method="post" accept-charset="utf-8" data-ajax="false">
                    <div class= "ui-hide-label">
                        <label for="email">Email</label>
                        &lt;input type="email" name="email" id="email" placeholder="Email"/&gt;
                    </div>
                    </br>
                    &lt;input type="submit" id="submit" value="Send info to mail" data-theme="b"/&gt;
                &lt;/form&gt;


and this is the function in my controller `search`:



Code:
function send_mail()
        {
            
                $config['protocol'] = 'smtp';
                $config['smtp_host'] = 'ssl://smtp.googlemail.com';
                $config['smtp_port'] = '465';
                $config['smtp_user'] = '[email protected]';
                $config['smtp_pass'] = '***********';
                $config['mailtype'] = 'html';
                $config['newline'] = "\r\n";
                $this->email->initialize($config);
    
                $this->email->from('mymail','User');
                $mail = $this->input->post('email');
                $this->email->to($mail);
                
                $id = $this->input->get('id');
                                            
                var_dump($id); die(); /* empty value */
                
                $this->email->subject('User Medical Info');
                $this->email->message();
    
                $data['title'] = 'Send mail';
                $data['result'] = $this->email->send();
    
                $this->load->view('templates/_header',$data);
                $this->load->view('_result_mail',$data);  
            
        }


I pass the value $id through get in the view but for a strange reason the get in controller give me a false as result. there is maybe a conflict between post and get?


Messages In This Thread
get method doesn't work properly - by El Forum - 02-20-2012, 04:43 PM
get method doesn't work properly - by El Forum - 02-20-2012, 05:36 PM



Theme © iAndrew 2016 - Forum software by © MyBB