Reputation: 11
When I was learning Php with Mysql, I got a problem :
<form action="?" method="POST">
.
.
.
</form>
Why do we put "?" in the action
attribute?
PS: this form was for inserting text into a database.
Actually, I have an Index.php
file which is the controller, and 2 files (form.html.php
and joke.html.php
as templates). In the tutorial, I first clicked on a link "add joke" to include the form.html.php
file and in this form there is <form action="?"> </form>
and a submit <input>
. When I click on submit, the controller index tests and executes the inserted SQL query.
Thanks.
Upvotes: 0
Views: 130
Reputation: 131
Personally don't ever do that.... Use action="action.php"
or use action=""
post to the current URL.
Not sure what you are trying to accomplish with ?
in the action attribute.
Upvotes: 1
Reputation: 318488
"We" don't and "You" shouldn't do so either.
action=""
.action="save.php"
.Upvotes: 0