|
The sc_error_exit macro interrupts code execution.
When used without a parameter, the macro uses a return, so when using it in a PHP method only the execution of the code in the method will be interrupted, returning to the originating event and executing the rest of the code. In this case, to interrupt the execution of the application event, the macro must also be used when returning the method.
This macro must be used after the macro sc_error_message();
Parameters
It has two parameters that are not mandatory and the use or not of the parameters interferes with the functioning of the macro.
| Parameter |
Description |
Parameter passing |
| app_name/URL |
This parameter is not mandatory.
When informed, whenever the macro is triggered, the user will be redirected to the informed application or page, which can be opened in the same tab or in a new one,according to the target parameter.
|
The application name or URL must be enclosed in double or single quotation marks.
Example with URL sc_error_exit('www.scriptcase.com.br');
Example with Application
sc_error_exit('app_Login');
|
| target |
This parameter is not mandatory.
It defines whether the application/URL will be opened in the same tab or in a new one.
Values can be:
- _blank - Which displays the application/URL in a new tab.
- _self - Displays the application/URL in the same tab as the application.
If no value is entered, the _self will be used as the default.
|
This parameter must be entered in double or single quotes.
Example opening the same tab sc_error_exit('www.scriptcase.com.br');
Example opening the same tab with target
sc_error_exit('www.scriptcase.com.br', '_self');
Example opening new tab
sc_error_exit('app_Login', '_blank');
|
Examples
Ex. 1: Displays only the error message.
sc_error_message("Error message");
sc_error_exit();
Ex. 2: Displays error messages and the "OK" button to redirect to the specified URL.
sc_error_message("Error message");
sc_error_exit(http://www.meusite.com);
Ex. 3: Displays error messages and the "OK" button to redirect to the informed Application.
sc_error_message("Error message");
sc_error_exit("my_application", "_blank");
|