Once you start building applications, you will add PHP code to events. Below is a list of pre-set functions you can use

functiondescriptionprototypereturnsNotes
getGUIDRetrieves a unique stringfunction getGUID()stringReturns a string that can be used for validation situations, i.e. for confirming credentials etc. In PHsPeed this string is used to let users validate their account.
inPostStateTests if the form has received form data or is in it's initials stateinPostState();true or falseif(inPostState() ){…}
isAjaxTests if the current module takes part in an Ajax handlerisAjax()true or falseif(isAjax()) { … }
isLoggedOnTestst if the current users is logged onisLoggedOn()true or falseif(isLoggedOn()) { … }
phspCryptEncrypts and Decrypts data.phspCrypt($string, $mode)stringavailable modes are: 'e' for encryption and 'd' for description. The key and salt used is setup in the project properties. This function is used by PHsPeed to store database credentials, emailing options etc. Once set in the IDE then do not change as this will make the encrypted files unreadable.

Sample: $mystr=phspCrypt($enc, 'e');
PHP redirectRedirects current form to another page.PHP redirect($url);nothingSample: PHP redirect('main.php');
rtrSubmitBtnRetrieves the id of the button clickedrtrSubmitBtn();stringThis function will return the button clicked. It is only to be used in the submit process and is not usable in ajax events. If you have more buttons on the form and want to take action depending on the submit button clicked then this function is useful.
Sample:

$key=rtrSubmitBtn();
if($key=='mail_btn_1') { …. }

The name of the button is the name that is used in its constructor (#module _ #name). So if the PHP modules name is 'myapp' and the button is called 'mybtn' then the function would return 'myapp_mybtn';
session_stopReleases session variables and closes current sessionsession_stop()nothingThis function will prevent data to be saved in a reusable session cookie after termination of the application.
functiondescriptionprototypereturnsNotes
showMessageDisplays a modal messageshowMessage($msg)nothing
In general this function can be used to submit and in ajax stage to display a popup message, but only on events that passes the $app object.

Example: $app→showMessage('process complete');

See also macro notation (@@showMessage('…');
functiondescriptionprototypereturnsNotes
@@login(…)will be translated to $app→login(…) For some commonly used functions, it is more convenient to use the @@ notation as PHsPeed will 'know' in what module the function resides. So you don't have to remember that login is part of the $app.
@@showMessagewill be translated to $app>showMessage(…)