2012-06-13 45 views
-3
$trial = $row['Trial']; 
$level = $row['membership_level']; 

print $trial; 

$number = count($domains); 
if (strlen($domain) == 0) {$number = 0;} 
if ($level == 4 and $number >= 10) {exit('You have reached your 10 domain limit and  cannot add anymore');} 
if ($level == 3 and $number >= 1) {exit('You have reached your 1 domain limit and cannot add anymore');} 
if ($level == 2 and $trail >= 1) {exit('You have already activated the trial, please purchase a license');} 

if ($level == 2) { 

根據打印,Trail = 1,level = 2根據它在下一條if語句失敗。但由於某種原因,它永遠不會失敗已知條件沒有被if語句捕獲

if ($level == 2 and $trail >= 1) 

我已經嘗試intval,strlen,並保持它獨自。它不會在這一點上失敗,即使我知道線索= 1和水平= 2

所以我缺少什麼?

+1

請不要讓自己體面的IDE,它會解決你的問題。 –

回答

4

您有拼寫錯誤試驗/線索:

$trial = $row['Trial']; 
... 
if ($level == 2 and $trail >= 1) 
+0

一個體面的IDE會告訴他! –