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

私はあなたがロジックをこのようにしたいと思っていると思います.

 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 に答える