users - Parse error: syntax error, unexpected '}' in C:wamp64wwwProiectaplicatieuser_check.php on line 18

Closed. This question is off-topic. It is not currently accepting answers.Your question should be specific to WordPress.

Closed. This question is off-topic. It is not currently accepting answers.

Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.

Closed 4 years ago.

Improve this question
//register users

$username= mysqli_real_escape_string($db, $_POST['username']);
$email= mysqli_real_escape_string($db, $_POST['email']);
$password1= mysqli_real_escape_string($db, $_POST['password1']);
$password2= mysqli_real_escape_string($db, $_POST['password2']);

//form validation

if(empty($username)){array_push($errors, "Username is required")};
if(empty($email)) {array_push($errors, "Email is required")};
if(empty($password)) {array_push($errors, "Password is required")};
Closed. This question is off-topic. It is not currently accepting answers.

Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.

Closed 4 years ago.

Improve this question
//register users

$username= mysqli_real_escape_string($db, $_POST['username']);
$email= mysqli_real_escape_string($db, $_POST['email']);
$password1= mysqli_real_escape_string($db, $_POST['password1']);
$password2= mysqli_real_escape_string($db, $_POST['password2']);

//form validation

if(empty($username)){array_push($errors, "Username is required")};
if(empty($email)) {array_push($errors, "Email is required")};
if(empty($password)) {array_push($errors, "Password is required")};
Share Improve this question edited May 19, 2020 at 0:05 Tony Djukic 2,2774 gold badges18 silver badges34 bronze badges asked May 18, 2020 at 22:09 RaluRalu 1 2
  • Can you provide a bit of context with your code? – Tony Djukic Commented May 19, 2020 at 0:04
  • 1 This doesn't appear to be a WP question, you should ask general PHP questions on stackoverflow – Tom J Nowell Commented May 19, 2020 at 0:05
Add a comment  | 

1 Answer 1

Reset to default 1

The semi-colons need to go inside the curly braces, to mark the ends of the array_push() statements:

if(empty($username)) { array_push($errors, "Username is required"); }
if(empty($email)) { array_push($errors, "Email is required"); }
if(empty($password)) { array_push($errors, "Password is required"); }

You don't need semi-colons after the close braces.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742421721a4440817.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信