I kullandığınızda PHP, konuyla ilgili değişkenler ile Çalışma ->

0 Cevap php

Ben php çok yeniyim, benim WAMP sunucu üzerinde bir php komut dosyası çalıştırmak için çalışıyorum, bu ben bu şekilde yapmak bir var bir değer atamak her zaman satın almak, bir komut dosyası deneyin ilk kez değil:

$var1="Value of the var";

Ama şimdi ben bu biçimi vardır bir komut dosyasını çalıştırmak için çalışıyorum ilk kez:

$user->logout('http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']);

I çağırdığınızda, düzgün çalışmıyor. Nedir ikisi arasındaki fark nedir? Neden benim sunucu komut işleyebilir?

***EDIT this is the code:

<?
/*
Basic login example with php user class
http://phpUserClass.com
*/
require_once 'access.class.php';
$user = new flexibleAccess();
if ( $_GET['logout'] == 1 ) 
    $user->logout('http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']);
if ( !$user->is_loaded() )
{
    //Login stuff:
    if ( isset($_POST['uname']) && isset($_POST['pwd'])){
      if ( !$user->login($_POST['uname'],$_POST['pwd'],$_POST['remember'] )){//Mention that we don't have to use addslashes as the class do the job
        echo 'Wrong username and/or password';
      }else{
        //user is now loaded
        header('Location: http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']);
      }
    }
    echo '<h1>Login</h1>
    <p><form method="post" action="'.$_SERVER['PHP_SELF'].'" />
     username: <input type="text" name="uname" /><br /><br />
     password: <input type="password" name="pwd" /><br /><br />
     Remember me? <input type="checkbox" name="remember" value="1" /><br /><br />
     <input type="submit" value="login" />
    </form>
    </p>';
}else{
  //User is loaded
  echo '<a href="'.$_SERVER['PHP_SELF'].'?logout=1">logout</a>';
}
?>

I have all the files on the server, this is the result: alt text

0 Cevap