CodeIgniter Forums
my Controller is not working - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: my Controller is not working (/showthread.php?tid=55044)



my Controller is not working - El Forum - 10-08-2012

[eluser]nencor[/eluser]
i have some controller like this
Code:
<td colspan="8">&lt;?php
                echo form_open('c_kategorimaterial/addkategorimaterial');
                echo form_submit('tambah','tambah');                
                echo form_close();
                ?&gt;</td>

then i copy paste them, then change into similiar controller that open different form

Code:
<td colspan="7">&lt;?php
                echo form_open('C_material/addmaterial');
                echo form_submit('tambah','tambah');
                echo form_close();
                ?&gt;</td>

why does the second controller is not working ?

edit : it works when i use

Code:
<td colspan="7">
                    <a href='&lt;?php echo base_url(); ?&gt;index.php/c_material/addmaterial'>Tambah</a>
                </td>

why does the button is not working ?




my Controller is not working - El Forum - 10-19-2012

[eluser]kreamik[/eluser]
i'm not sure .. but is it typo ?
C_material should be c_material


my Controller is not working - El Forum - 10-19-2012

[eluser]Beginers[/eluser]
you post the whole code your first and second controller


my Controller is not working - El Forum - 10-19-2012

[eluser]alexwenzel[/eluser]
What you pasted is not a controller but its a view.

Tip: generate your urls this way to be more flexible and save:

Code:
<a href='&lt;?php echo site_url("c_material/addmaterial"); ?&gt;'>Tambah</a>