Link a PHP file in HTML

Hi! I’m new there, so sorry for not knowing how to use the forum :slight_smile: Nevermind.
I have a HTML project and I’m trying to link a PHP file to it for processing forms.
Assuming that the HTML file is mainpage.html and the php file is form_sub.php, I tried (didn’t work)
So how can I link my php file to the html file?

Are you running a php server? In order to achieve what you want, you have to make a request to a server (this server can run locally on your machine), then PHP can process the request and send back a response.

I’m new in programming, I don’t really know what are you saying…

the browser understands html, it doesn’t understand PHP. You will need a piece of software (like xampp), to glue it altogether.

a website consist of two parts: front-end (the page the user sees), and a back-end (where you handle form submission, with php for example)

OK. Thank you, I’ll try and see if I can do something with xampp

that probably requires some reading as well. Good luck, let me know if i can help you with something

Isn’t there any other way? XD It seems Xamp doesn’t work on my computer… I’m trying to open from service.exe

and then what happens? have you checked your taskbar for xampp?

xampp is the easier solution so far i know, it bundles apache and php. You could manually install apache and PHP, which is more difficult

you could consider a pre-configured docker container, again, not easy.

Getting PHP to run the first time is not easy, all the tools you need require figuring out