Etikettarkiv: PHP

PHP, Array and implode

This is more or less a note, when my brain takes a vacation.

php

I have a form, where the user could select one or several lines from either the right or left boxes.

snippet

This is a part of  html code (actually PHP), remember to have [ ], this indicates a array. The user could select just one, or several.

implode

In my form handler (in a Docker container, communicate with SendGrid), I use implode to convert the array to string.

It will handle the data and process the data to sql, updating MYSQL database in another Docker container, after that it will send a email with the data.

email

 

Facebooktwittergoogle_plusredditpinterestlinkedinmail

Error 500 Apache2 and PHP

This is more a note for me, to remember this when my memory steps away!

 

In PHP, I have:

Code snippet:

session_start();

ini_set(‘display_errors’,1);
ini_set(‘display_startup_errors’,1);
error_reporting(-1);

 

Throws a 500 error, when I tried to access the page.

You have to add this line in .htaccess:

php_flag display_errors 1

And then restart the server with:  service apache2 restart

Referens: http://stackoverflow.com/questions/17693391/500-internal-server-error-for-php-file-not-for-html

Facebooktwittergoogle_plusredditpinterestlinkedinmail