Form Action URL Question |
Hi,
I'm new to Codeigniter4. And I have a question about something that I don't understand. First let me say that the tool bar above is difficult to make out even at 120%, the left most icons are difficult to see. But we'll live with it as-is for now. I created a form that has an action parameter as follows... Code: <form action="<?= base_url() ?>/users/store"> Code: http://localhost/ci4/users/store? Ask me questions if needed, I am more than happy to provide more information. Thanks, Charles.
Did you end your app/Config/App.php base_url with a forward / ?
It could also be the url protocol setting try changing it to another one. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(08-02-2021, 09:04 AM)Charles Luck Wrote: Hi, What is your form method? Post or get?
the way i use form is to include bootstrap layout and submit to a route .
eg Code: <?=form_open('contact') ?> in routes.php i have Code: $routes->post('contact','Sendmail::processform'); in the post i'm defining "POST" rather than "GET" get requests usually have a ? in url , so maybe thats something to do with yours . in the above i'm saying that any FORM POST directed to "contact" will invoke the above & be dealt with a controller called Sendmail and its method processform. In your controller you can get all the values a web surfer has entered into a form and process then any way you want. In my case some checking/filtering goes on and then if Ok i get sent the values to my email address. |
Welcome Guest, Not a member yet? Register Sign In |