Unfortunately, the username and password you have entered do not match!

Registration

Unfortunately, this username is already taken!

Unfortunately, this e-mail address is already used!

Please retype the verification code.

All fields are required

RSForm!Pro - Display PHP variables by default when form is shown

Display PHP variables by default when form is shown

With RSForm!Pro you can display variables like user information (if the user is logged in) directly in the form components that you create.

Examples:

Assuming that you want to create an e-mail form component, and by default, if the user is logged in, to enter it's registration e-mail in the Email field. Here's how to do it:

  1. Create a textbox component
  2. In the Default Value, type this code:

    //<code>
    $rsuser=JFactory::getUser();
    $user=$rsuser->get('email');
    return $user;
    //</code>

This piece of code (including the // tags) loads the user information in the $user variable. Here's what you can use:

  • $rsuser->get('id') = user id
  • $rsuser->get('username') = the username
  • $rsuser->get('name') = registration full name
  • $rsuser->get('email') = registration email

Feedback