/
Example of form integration in PHP

Example of form integration in PHP

not to be used in production

Contents of this documentation:

Code

The example discussed here generates a page with:

  • iframeresizer;

  • a post-submission redirection callback of the form on the page itself;

  • the positioning of the URL sent by email to the page itself.

Deploy from the source

Build Docker

The source code is available on github:GitHub - fairandsmart/simple-consent-integration-example: Some code to demonstrate how to integrate a consent form created using Fair and Smart Right Consent platform.

  • start by retrieving the source code: git clone https://github.com/fairandsmart/simple- consent-integration-example.git ;

  • Adjust the configuration in the config.ini file;

  • then launch the image creation via docker build --tag simple-consent-integration-example.

Run Docker

Once the image has been created, start the container via docker run simple-consent-integration-example

Deploy from docker image

The image is available on dockerhub: https://hub.docker.com/r/fairandsmart/simple-consent-integration-example .

  • start by retrieving the image: docker pull fairandsmart/simple-consent-integration-example;

  • create a "my-configuration.ini" configuration rile based on the example available in the github repo (

simple-consent-integration-example/config.ini at master ยท fairandsmart/simple-consent-integration-example );

  • then start the container: docker run --mount type=bind,source=$PWD/ma-configuration.ini, target=/var/www/html/my-config.ini -e CONFIG_FILE_PATH="ma-configuration.ini" fairandsmart/simple-consent-integration-example;

Test

Once the container has been started, go using a browser to the IP indicated in the logs, for example to http://172.17.0.2:

$ docker run --mount type=bind,source=$PWD/my-config.ini,target=/var/www/html/my-config.ini -e CONFIG_FILE_PATH="my-config.ini" fairandsmart/simple-consent-integration-example AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.4. Set the 'ServerName' directive globally to suppress this message AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.4. Set the 'ServerName' directive globally to suppress this message [Fri Nov 20 17:16:40.178591 2020] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.38 (Debian) PHP/7.2.34 configured -- resuming normal operations [Fri Nov 20 17:16:40.178616 2020] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'

To find out more