普通网友
2015-09-10 15:32
浏览 20
已采纳

PHP在文本框中提交名称

I have just started learning php. However I am having trouble with the code below. I know it automatically prints out You're not a member... But when I then enter "letmein" it still says I am not a member. Any guidance would be much appreciated

    <html>
    <head>
    <title>A BASIC HTML FORM</title>

    <?PHP

    $username = $_POST['username'];

    if ($username == "letmein") {

    print ("Welcome back, friend!");

    }
    else {

    print ("You're not a member of this site,goodbye");

    }

    ?>


    </head>
    <body>
    <FORM NAME ="form1" METHOD ="POST " ACTION = "basicForm.php">


    <INPUT TYPE = "TEXT" VALUE ="username" Name="username">
    <INPUT TYPE = "Submit" Name = "Submit1" VALUE = "Login">

    </FORM>
    </body>
    </html>
  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题