![]() |
Procession Form data outside CI framework. - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Procession Form data outside CI framework. (/showthread.php?tid=25248) |
Procession Form data outside CI framework. - El Forum - 12-05-2009 [eluser]Unknown[/eluser] Hi I am a newbie to CI, actually I inherited it from a client. The previous programmer left so I was force to start learning it and actually liking it. I have a problem where a contact form was setup in the controllers, not in view etc. I was wondering is there a way to process the form data outside the CI framework. can I just direct <form id="contact-form" action="send_email.php" method="POST"> I tried that but it does not do anything. Any help will be great appreciated. Cheers Procession Form data outside CI framework. - El Forum - 12-05-2009 [eluser]jedd[/eluser] Hi RedwineShiraz and welcome to the CI forums. [quote author="RedwineShiraz" date="1260065822"] ... learning it and actually liking it. [/quote] This is a common reaction - don't fight it ![]() With your form - you should just be able to change the action to point somewhere else, and do what you like with it. What are you trying to achieve / avoid by doing this? You might have to absolute-path the action= bit, of course, to take it exactly where you have your receiving page. Procession Form data outside CI framework. - El Forum - 12-06-2009 [eluser]Unknown[/eluser] Hi Jedd thanks for your response. I haven't tried the absolute path. I will give it a try and see what comes out of it. What I am trying to accomplish is using the form created by the previous programmer. He created this form inside a varible in the index function of the contact form controller. Example: class Contact extends Controller { function index() { $this->load->helper('url'); $content = <<<EOD <form id="contact-form" action="send_email.php" method="POST"> [html form code here] </form> } $this->load->view('template', array("pageTitle" => "Contact Us", "pageContent" => $content,"pageSel" =>contact" ) ); }} As you can see my modification was to add the action="send_email.php" method="POST" hoping that should work with like I would with a regular site without the CI framework. But that didn't work. I tried placing send_email.php in the application folder but that did not work. I will try the absolute path. In the long run I can see the work put into building a site with a CI framework can be modular and easy to maintain down the road. Of course, done according to how the framework was intended to be used. PS: I tried the absolute path that will not work when RewriteRule ^(.*)$ /index.php/$1 [L] is on. When that is removed it works. Is there a way to have the RewriteRule turn on and still have the absolute path work? Procession Form data outside CI framework. - El Forum - 12-07-2009 [eluser]jedd[/eluser] [quote author="RedwineShiraz" date="1260169542"] PS: I tried the absolute path that will not work when RewriteRule ^(.*)$ /index.php/$1 [L] is on. When that is removed it works. Is there a way to have the RewriteRule turn on and still have the absolute path work? [/quote] If the absolute path that you are heading towards is within your CI application, then this will fail - unless you modify your .htaccess file to allow it. But that doesn't make sense, because you said this is a page that is outside of your CI application. If it's within your CI application, then you don't want to absolute path it - as presumably something within CI is meant to handle it. Procession Form data outside CI framework. - El Forum - 12-18-2009 [eluser]charlie spider[/eluser] If it is within your CI framework then send_email.php would have to be within your application/controllers folder not just your application folder. You may already know this and just wrote your response that way to save time, but being a newbie you may have missed that, so sorry for pointing out the obvious if you already knew this. can you show your entire absolute path ??? |