I want to call a controller with method onclick. I solved this, but I want to find a solution for this.
<button type="button" class="btn btn-success" onclick="<?php ?>">Sign Up</button>
Try this code:
<button type="button" class="btn btn-success" onclick="window.location='<?php echo site_url("controller/fun_name");?>'">Sign Up</button>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With