2016-04-07 8 views
0
<?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文ファイルが書き込まれていない

+1

submit_btn単に優しい先端、あなたはこのページの上に読むことをお勧めします:[ハウツー-ASKガイド](https://でstackoverflow.com/help/how-to-ask)ので、質問が簡単に答えることができ、できるだけ明確であることを常に確認することができます。あなたが抱えている問題を修正するためにあなたがした努力と、それらの修正を試みたときに何が起こったのかを必ず含めてください。ショーコードとエラーメッセージも忘れないでください! –

答えて

0

誤植内部に入ったことはありません: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///// 
+0

submit_btnはLOGINフォームのサブミット名です... submitbtnは2番目のフォームの名前です...ページには2つのフォームがあります –

+0

次フォーム/ウェブサイトで次のフォームを押すと、最初のボタンは押されませんコール。セッション – djot

+0

最初にボタンが押された後にフォームが表示され、フォームの送信を押すと何も起こりません。 –

関連する問題