![]() |
submit button not redirecting - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: submit button not redirecting (/showthread.php?tid=63520) Pages:
1
2
|
submit button not redirecting - pallu.hegde93 - 11-09-2015 I'm trying to make a simple codeigniter signup form, but when I press the submit button nothing happens. Not sure what is going wrong. please help. I've posted both my view file and the contoller which i am re-directing in the form. Code: <div id="newsletter_form"> And the below one is my email.php file Code: <?php RE: submit button not redirecting - mwhitney - 11-09-2015 Well, given what you've posted here: - The controller's class and file name should start with an uppercase letter "Email" and "Email.php" - The constructor should be: PHP Code: public function __construct() (note that it starts with two underscores (__), not one. - You shouldn't echo from your controller, especially right at the beginning of your send() method, since this may prevent some or all of the code after the echo from executing properly and will eventually cause errors if you try to load a view. - I'm assuming you just stopped copying the code at whatever point you thought was relevant, as you don't have closing braces for either the send() method or the class. RE: submit button not redirecting - pallu.hegde93 - 11-09-2015 hi, I did try the constructor, but it doesnt work,if i run email.php the the view gets loaded but the submit isnt redirected. The send function also works when i run separately. But the form submit doesnt work. (it doesnt redirect to the send function) RE: submit button not redirecting - pallu.hegde93 - 11-09-2015 I have tried the constructor part. but it didnt work either. In my file email.php the view gets loaded but the submit doesnt redirected to send method in contoller. Also the send method works fine separately. RE: submit button not redirecting - InsiteFX - 11-10-2015 PHP Code: class email extends CI_Controller RE: submit button not redirecting - mwhitney - 11-10-2015 You probably need to use a different name for your controller. When you load the Email library from an Email controller, it's probably not going to work out very well. RE: submit button not redirecting - pallu.hegde93 - 11-10-2015 Tried with both Email and a different name. But nothing changed ![]() ![]() RE: submit button not redirecting - Martin7483 - 11-11-2015 Could you post your complete code for Controller and view files. RE: submit button not redirecting - pallu.hegde93 - 11-11-2015 I have attached both the files. RE: submit button not redirecting - pdthinh - 11-12-2015 (11-11-2015, 09:02 PM)[email protected] Wrote: I have attached both the files. In your view file modify this line: PHP Code: echo form_open("blog/send"); // blog starts with lower case letter In the controller you can use simplified send() method to test if the view can submit to it: PHP Code: function send() |