0

有谁知道下面的语句应该是什么样子?我尝试了多种结构,例如 while 循环和 switch 语句,但我无法弄清楚。我知道下面的代码是完全错误的,只是想显示我想要的

if($numrows > 0)
  {
    if($this->currentURL() == 'http://localhost/webshop/public/index.php?page=login.php')
      {
        $this->redirect();
      }
  }
else
  {
    echo "Wrong Username or Password!";
  }
if($numrows > 0)
  {
    if($this->currentURL() == 'http://localhost/webshop/public/index.php?page=register.php')
      {
        echo "Already in use!";
      }
  }
else
  {
    $this->insertRows();
  }
4

1 回答 1

0

I am guessing you want the logic to be like this,

 if($numrows > 0)
  {
      if($this->currentURL() == 'http://localhost/webshop/public/index.php?page=login.php')           
          $this->redirect();   
      else if($this->currentURL() == 'http://localhost/webshop/public/index.php?page=register.php')  
              echo "Already in use!";                 
          else      
              echo "Wrong Username or Password!";    
  }
  else         
      $this->insertRows();   
于 2013-01-21T15:51:38.363 回答