最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin0浏览0评论
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.

发布评论

评论列表(0)

  1. 暂无评论