参见英文答案 >
What does an entry “action=’?’” in html form mean?6
我正在关注PHP MysqL新手到忍者: @H_301_3@下面的表单模板
我正在关注PHP MysqL新手到忍者: @H_301_3@下面的表单模板
<form action="?" method="post"> <div> <label for="joketext">Type your joke here:</label> <textarea id="joketext" name="joketext" rows="3" cols="40"></textarea> </div> <div><input type="submit" value="Add"></div> </form>@H_301_3@PHP控制器的一部分:
if(isset($_POST['joketext'])) //insert block { try { //prepared starement $sql = 'INSERT INTO joke SET joketext = :joketext,jokedate = CURDATE()';@H_301_3@“?”做表单动作