How to create a landing page

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
Eric1982
User
Posts: 57

How to create a landing page

Post by Eric1982 »

How can I create a landing page for my user, indiviually? For instance, with a personal greeting. The page should be updated frequently.


mobhar
User
Posts: 11761

Post by mobhar »

It seems you want to display the welcome message just right after a user has successfully logged in and redirect him/her to the certain page. If so, then you may simply put the following code in "User_LoggedIn" server event:

$this->setSuccessMessage("Welcome, " . CurrentUserName()); // display welcome message to current user
$this->Page_Terminate("orderslist.php"); //assume redirect to Orders page


Eric1982
User
Posts: 57

Post by Eric1982 »

Great that works. Can I also assign specific pages to each group of users: for instance, I would like that the sales people to see page sales.php and people from finance page finance.php ?


mobhar
User
Posts: 11761

Post by mobhar »

Try this:

$this->setSuccessMessage("Welcome, " . CurrentUserName()); // display welcome message to current user
if (CurrentUserLevel() == "1") { // assume 1 = sales
$this->Page_Terminate("sales.php");
} elseif (CurrentUserLevel() == "2") { // assume 2 = finance
$this->Page_Terminate("finance.php");
} else { // default
$this->Page_Terminate("index.php"); // default, redirect to index.php
}


Eric1982
User
Posts: 57

Post by Eric1982 »

Thank you mobhar ! Can I also arrange that a specific landing page can be edited by an assigned user?


mobhar
User
Posts: 11761

Post by mobhar »

Sure you can. Just use a variable to catch the value of your custom landing page.


Post Reply