<?php
if(isset($_POST['submit_btn']))
/////code here//////
/////the program actually gets inside this if statement after the user submits login info
if(strpos(file_get_contents("accounts.txt"),$text) !== false) : ?>
/////html form displays here...and the submit button name of the form is submitbtn//////
<input type="submit" name="submitbtn" value="Submit" onclick="giveaway()">
<?php endif; ?>
<?php
if(isset($_POST['submitbtn']))
//////the content here never runs, regardless if I click submit or not/////
有没有人知道为什么当我点击表单的提交按钮时,php代码在它运行之后?它永远不会进入if语句
答案 0 :(得分:0)
错字:submit_btn
与submitbtn
<?php
if(isset($_POST['submitbtn']))
/////code here//////
/////the program actually gets inside this if statement after the user submits login info
if(strpos(file_get_contents("accounts.txt"),$text) !== false) : ?>
/////html form displays here...and the submit button name of the form is submitbtn//////
<input type="submit" name="submitbtn" value="Submit" onclick="giveaway()">
<?php endif; ?>
<?php
if(isset($_POST['submitbtn']))
//////the content here never runs, regardless if I click submit or not/////