Login script not working as required

后端 未结 2 1153
甜味超标
甜味超标 2021-01-22 09:15

I am new to php and tried to develop a login script but when i enter values it is not working. I cant even find the errors because when i click on submit it just refreshes the p

2条回答
  •  庸人自扰
    2021-01-22 09:37

    You are using form method="post", yet looking for $_GET.

    Either use method="get" or $_POST!

    As you have gathered from the comments there are several other issues with your code with regards to security. Don't be disheartened - everyone was a beginner once. However, you really should read up on SQL Injection and stop assigning all the $_GET values to strings - name each of them in full, ie:

    $user_name = trim($_GET['user_name']);
    

    Good luck, and stick with it!

    [edit]Ah, as Stephen rightly points out in the comments, the JS uses get to submit the post, so it's actually the field name of 'email' that's the problem.

提交回复
热议问题