I'm trying to build my first website. I have a domain name and am building it on my laptop before uploading it to my host. The website is mostly focused around searching a database of family tree information.
I have created a basic HTML file which seems to be working ok. I have a search button linked to a PHP file. Ideally when someone used the button without putting in parameters it should reply with an error message that says "search term is missing" but instead it shows all the code for the PHP file. I've never done anything like this before so am more than a little confused.
Welcome to the web development world !;)
the php file must have a .php extensions, and should begin with <?php and end with ?>
you probably forgot one of those :)
Your browser will not understand php by itself, on a given web server there's a number of layers for compiling PHP etc. Try XAMPP, you'll have it up and running in no time and you can see your PHP at work by simply looking up localhost with your browser.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With