POST Parameters#
In Miva Merchant, managing parameters, whether from URL queries or form submissions, is a fundamental aspect of web development. This documentation elucidates the mechanisms through which Miva Merchant seamlessly handles parameters, thereby simplifying data retrieval and manipulation for developers.
URL Parameters#
- Automatic Parsing: Miva Merchant automatically parses parameters appended to URLs, converting them into accessible global variables.
- Global Variable Naming: Parameters appended to a URL, such as
&name=John
, are transformed into global variables with consistent naming conventions, e.g.,g.name
.
Form Parameters#
- Effortless Retrieval: Miva Merchant seamlessly extracts parameters submitted via forms, making them accessible as global variables.
- Global Variable Assignment: Form inputs, including hidden inputs, are automatically parsed and assigned as global variables for convenient access.
Example#
- Form Submission:
<input type="hidden" name="custom_variable" value="This is a test">
- Accessing Parameter:
&mvte:global:custom_variable;
Best Practices#
- Entity Encoding: Always utilize entity encoding (
&mvte:
) when outputting parameters to the screen to prevent cross-site scripting (XSS) vulnerabilities. - Parameter Output: Ensure parameter values are securely encoded before displaying them on web pages to mitigate security risks.
Summary#
Understanding and effectively managing parameters within Miva Merchant are indispensable skills for web developers. By leveraging Miva’s automatic parameter handling mechanisms, developers can streamline data retrieval, processing, and output, enhancing the efficiency and security of web applications. Mastery of parameter handling concepts empowers developers to create robust and dynamic web solutions using Miva Merchant’s versatile platform.