submit button not redirecting |
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
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.
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)
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. PHP Code: class email extends CI_Controller What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
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.
(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() |
Welcome Guest, Not a member yet? Register Sign In |