Customize User Add page

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

Customize User Add page

Post by Dalila »

hi, I need to customize the "Add user page": when I create e new user (with username and password(md5) ), before to click "ADD", I would like to print the page in pdf and customize this page with logo, other text, address and frame.

is possible to do this? and in which way?

thank a lot for help me


mobhar
User
Posts: 11700

Post by mobhar »

Try "Custom Files" of PHPMaker and PDF PHP third-party library. Just Google for more info.


Dalila
User
Posts: 26

Post by Dalila »

hi,
I added pdf folder and I create e file "formpdf".php but how can I do for using this file when I add e new User (when I push "ADD" on Useradd.php file) ?

thank's again for help me


mobhar
User
Posts: 11700

Post by mobhar »

Put this code in "Row_Inserted" server event:

$this->Page_Terminate("formpdf.php");


Dalila
User
Posts: 26

Post by Dalila »

Thank you so mutch. I did.


Dalila
User
Posts: 26

Post by Dalila »

Hi, when I added a customer is it possible to include username and password from user table in the formpdf?


mobhar
User
Posts: 11700

Post by mobhar »

You may simply use CurrentUserInfo() global function which has one param as the field name, for example, you want to get the current Password user, then simply use:

if (IsLoggedIn()) {
echo "<br>Current Username: " . CurrentUserName(); // <-- or you may also use CurrentUserInfo("Username") assume the field name is "Username"
echo "<br>Current Password: " . CurrentUserInfo("Password"); // <-- assume the field name is "Password"
}


Chris
User
Posts: 162

Post by Chris »

Do not use CurrentUserName() or CurrentUserInfo() because this will return your own username and password, pretty sure you are not looking to print that info into a PDF for someone else.

On an add page, you will have access to the $rsnew array which contains all of your required info. Use $rsnew['required_field'] to access this info.


Dalila
User
Posts: 26

Post by Dalila »

I tried to add current user name and password in phpform.php but in this way:
if (IsLoggedIn()) {
echo "<br>Current Username: " . CurrentUserName("username"); // <-- or you may also use CurrentUserInfo("Username") assume the field name is "Username"
echo "<br>Current Password: " . CurrentUserInfo("password"); // <-- assume the field name is "Password"
}

But I need to call the function to use this.
How to do?

thank's a lot for your help


mobhar
User
Posts: 11700

Post by mobhar »

Make sure you have already created "phpform.php" file via "Custom Files", and you have enabled "Includes common files" for that Custom File.

Please read "Custom Files" topic from PHPMaker Help menu for more info and example.


Post Reply