-3

我的 activate.php 代码如下

<?php
  if(isset($_GET['id']) && isset($_GET['u']) && isset($_GET['e']) isset($_GET['p']) {
   include_once("pathname");
    $id= preg_replace("#[^0-9]#i","",$_GET['id']);
    $u = preg_replace("#[^a-z0-9]#i","",$_GET['u']);
    $e = mysqli_real_escape_string($db_conx,$_GET['e']); 
    $p = mysqli_real_escape_string($db_conx,$_GET['p']); 
   if($id == "" || strlen($u) < 3 || strlen($e) < 5 || $p == ""){
     header("location: message.php?msg=activation_string_length_error");
     exit();
   }
 $sql ="SELECT * FROM users WHERE id='$id' AND username='$u' AND email='$e' AND password='$p' LIMIT 1";
 $query = mysqli_query($db_conx,$sql);
 $numrows = mysqli_num_rows($query);
    if($numrows == 0){
     header("location: message.php?msg=Your Creditentials are not matching anything in our  system");
    exit();
  }
  $sql = "UPDATE users SET activated='1' WHERE id='$id' LIMIT 1";
  $query= mysqli_query($dbconx,$sql);
  } else {
   header("location: message.php?msg=missing_GET_variables");
   exit();
   }
 ?>

不知道为什么我会收到这条消息?它说它是第 2 行,有一个意外的 T_ISSET,我没有任何我不认为的,我对 PHP 相当陌生,所以如果有人可以向我解释如果你发现错误我做了什么?

4

4 回答 4

4

您的if陈述是罪魁祸首,您缺少右括号和逻辑运算符&&

if(isset($_GET['id']) && isset($_GET['u']) && isset($_GET['e']) && isset($_GET['p'])) {

缺少最后一个 和之前的if逻辑运算符的右括号。&&isset

于 2013-08-20T19:44:29.810 回答
1

你有一个 && 和关闭丢失

if(isset($_GET['id']) && isset($_GET['u']) && isset($_GET['e']) isset($_GET['p']) {

应该

if(isset($_GET['id']) && isset($_GET['u']) && isset($_GET['e']) && isset($_GET['p'])) {

谢谢

于 2013-08-20T19:45:12.647 回答
1

您错过了and之间的逻辑运算符isset($_GET['e'])isset($_GET['p'])

于 2013-08-20T19:46:47.643 回答
0

错字:

if(isset($_GET['id']) && isset($_GET['u']) && isset($_GET['e']) isset($_GET['p']) {
                                                             ^^^^---here

您可能忘记了逻辑运算符&&

于 2013-08-20T19:43:58.237 回答