How to include PHP code in an htmlpage |
How to include PHP code in an htmlpage |
Forca |
May 10 2017, 02:20 AM
Post
#1
|
Member Group: Members Posts: 33 Joined: 29-April 16 Member No.: 24,203 |
Hi
I have a website with a form the user has to complete in order to register. I have a PHP script running server side which sanitises the user input and adds it as a another row in a MySQL table. I have implemented various checks and balances on the user input. I would like the error messages (due to user input error/mistakes) to be displayed on a webpage with my company logo, heading, etc. I've called this my error page. Instead of creating a separate html page for each possible error message, I would like to write all the error messages into an array in PHP. The idea is then to scroll through the array (using FOREACH) and gather all array keys with non-zero data (i.e. error messages in them) into one package and write them all out one time to a html page with my company header, logo, etc. I have created the html page, but how do I get the PHP collection of error messages to display on this html error page? In other words how to write PHP code from a server side script to an existing html page? Thanks. |
Lo-Fi Version | Time is now: 18th April 2024 - 07:23 PM |