CodeIgniter Forums
form submit PROBLEM ! PLEASE HELP - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forum-22.html)
+--- Thread: form submit PROBLEM ! PLEASE HELP (/thread-40820.html)



form submit PROBLEM ! PLEASE HELP - El Forum - 04-19-2011

[eluser]Cosmic[/eluser]
Hi there,

I have a problem with form submit, the problem is this:
When I try to submit my form from localhost I cant retrieve any variable from my form(I`m using latest wamp server on my localhost)
If I upload my site on internet server everything works fine


PLEASE help me with this, I`ll be very greatfull about it

Thanks!


update:

.. is not problem with my wamp server I try some very simple form and is working fine, the problem is with CI but I don`t know what

please help guy`s


form submit PROBLEM ! PLEASE HELP - El Forum - 04-19-2011

[eluser]InsiteFX[/eluser]
Thank you!

Now please post your form code using code tags, so that we may be able to help you out.

InsiteFX


form submit PROBLEM ! PLEASE HELP - El Forum - 04-19-2011

[eluser]Cosmic[/eluser]
OK, thanks for being patient

code is like this

contact_view.php


Code:
// above code is not posted, because I think that is not important


//below is my test $_POST code

                  &lt;?php if(isset($name))echo 'name='. $name.'<br>';?&gt;
                  &lt;?php if(isset($email))echo 'e-mail='. $email.'<br>';?&gt;
                  &lt;?php if(isset($subject))echo 'subject='. $subject.'<br>';?&gt;


//end of test



//below is my form
&lt;?php echo form_open("/contact"); ?&gt;
                            <p>
                                <label>Name</label>
                                &lt;input type="text" name="name" id="name" /&gt;
                            </p>
                            <p>
                                <label for="e-mail">E-mail</label>
                                &lt;input type="text" name="email" id="e-mail" /&gt;
                            </p>
                            <p>
                                <label for="subject">Subject</label>
                                &lt;input type="text" name="subject" id="subject" /&gt;
                            </p>
                            <p>
                                <label for="message">Message</label>
                                &lt;textarea type="text" name="message" id="message" &gt;&lt;/textarea>
                            </p>

                            <p>
                               &lt;?php echo form_submit(array('value'=>'Send','name'=>'submit', 'id'=>'submitButton')); ?&gt;
                            </p>
                        &lt;?php echo form_close(); ?&gt;

.. and this is my contact.php - controller


Code:
// this is whole contact.php controller

&lt;?php
    class Contact extends CI_Controller {
        
        function __construct()
        {
//             Call the Controller constructor
            parent::__construct();
    //        $this->load->database();
    //        $this->load->model('path_mod');
    //        $this->load->model('services_mod');
    //        $this->load->model('head_mod');
            
            $this->load->helper(array('form', 'url'));
     //       $this->load->library('form_validation');
     //       $this->load->library('email');
        }
        
        function index()
        {
    //        $data_head['head'] = $this->head_mod->get_metadata_contact();
   //         $data_head['title'] = $this->head_mod->get_contact_title();
   //         $data_view['path'] = $this->path_mod->load_menus_path();
   //         $data_header_footer['menu'] = $this->path_mod->load_menus_path();
        
  
                $data_view['name'] = $this->input->post('name');
                $data_view['email'] = $this->input->post('email');
                $data_view['subject'] = $this->input->post('subject');
            
                        

//           $this->load->view('headinclude',$data_head);
//           $this->load->view('header',$data_header_footer);
            $this->load->view('contact_view',$data_view);
  //          $this->load->view('footer',$data_header_footer);
        }
    
    
    }

?&gt;


... I made this as simple as I can, I just what to remind you that when I upload this code to internet server is working normal like it should be


Thanks!


form submit PROBLEM ! PLEASE HELP - El Forum - 04-19-2011

[eluser]Rok Biderman[/eluser]
After i changed the action from
Code:
&lt;?php echo form_open("/contact"); ?&gt;
to
Code:
&lt;?php echo form_open(""); ?&gt;
your code worked perfectly for me, so (unles for this lapse) your problem is elsewhere.


form submit PROBLEM ! PLEASE HELP - El Forum - 04-19-2011

[eluser]InsiteFX[/eluser]
The form_open is:
Code:
&lt;?php echo form_open("controller/function"); ?&gt;

InsiteFX


form submit PROBLEM ! PLEASE HELP - El Forum - 04-20-2011

[eluser]Cosmic[/eluser]
I have being try everything that I come up with, no solution for me.

But thank you, for you time


form submit PROBLEM ! PLEASE HELP - El Forum - 04-20-2011

[eluser]Cosmic[/eluser]
Solved!

Just turn your Apache rewrite_module on, and everything is working fine again Smile

Thanks!