Note that there are some explanatory texts on larger screens.

plurals
  1. POCode Igniter Bonfire ajax request 500 internal server error
    primarykey
    data
    text
    <p>So I am trying to submit just an email address using ajax to get people to register and I have no idea why I am getting a 500 internal server error. I am new to ajax calls.</p> <p>I have tried to follow the following tutorial: <a href="http://www.youtube.com/watch?v=TZv5cgua5f0" rel="nofollow">http://www.youtube.com/watch?v=TZv5cgua5f0</a> However I have done as they have said and still if I do a post with values I do not get to the desired controller method. If I do add data to the post then I get an internal server error.</p> <p>javascript:</p> <pre><code>$('#email_submit').click(function() { var form_data = { users_email: $('#users_email_address').val() }; $.ajax ({ url: 'http://localhost/myZone/NewsLetter/submit', type: 'POST', data: form_data, success: function(msg) { alert(msg); } }); return false; }); </code></pre> <p>HTML</p> <pre><code>&lt;div id="email_newsletter_signup" class="ajax_email_block_signup" &gt; &lt;h3&gt;Sign up to the newsletter:&lt;/h3&gt; &lt;?php echo form_error('signup_email','&lt;div id="email_error" class="error"&gt;','&lt;/div&gt;');?&gt; &lt;h3&gt;email: &lt;input id="users_email_address" type="email" name="signup_email" value="&lt;?php echo set_value('signup_email'); ?&gt;" placeholder="Your email"/&gt; &lt;/h3&gt; &lt;input id="email_submit" type="submit" name="submit"/&gt; &lt;/div&gt; </code></pre> <p>contoller</p> <pre><code> public function index() { Assets::add_module_js('newsletter','email.js'); //If included will be added Template::set_block('email_block','email_block'); Template::render(); } public function submit($email) { $success = $this-&gt;newsletter_model-&gt;set_unverified_email($email); // if($success === FALSE) // { // Template::set_block('newsletter_error','newsletter_error'); // } // else // { // Template::set_block('newsletter_success','newsletter_success'); // } // Template::render(); return; } </code></pre> <p>I have a breakpoint inside the submit and it just wont be hit when I do a post</p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload