2012-08-11 56 views
1

我是joomla 1.5中的新成員。 我正在嘗試實施調查表。如果用戶不是註冊用戶,則他或她可以在提供他或她的電子郵件地址和電話號碼後訪問調查表。否則,如果用戶是註冊用戶,則他/她可以直接訪問調查表,不需要提供電子郵件或電話號碼。然後根據調查,管理員可以通過該電子郵件ID或電話號碼與他/她進行互動。 我應該如何根據這種情況進展。在訪問調查前輸入電子郵件地址和電話號碼

回答

0
//detect if a user entity exists in the session: 
$user = JFactory::getUser(); 
if ($user->guest) { //this is a registered user 
    //redirect to the survey page 
    header('Location: http://www.example.com/your-survey'); 
} 
else{ 
    //display a form 
    //with email & phone number 
} 
相關問題