The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> How to include PHP code in an htmlpage
Forca
post 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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 16th April 2024 - 03:22 AM