0

In firefox I repeatedly tried to get PHP working, but no luck

My code is as follows:

<!DOCTYPE html>
    <html>
        <body>

            <h1>My first PHP page</h1>

            <?php
                echo "Hello World!";
            ?>

        </body>
    </html> 

I used PHP format, but it wanted to save the script again. XML threw a boatload of errors. HTML did not show the PHP

IMSoP
  • 89,526
  • 13
  • 117
  • 169
Velcro
  • 1
  • 1
    this all depends on your webserver and php settings. Check this reply: https://stackoverflow.com/questions/22853669/how-can-i-run-a-php-script-inside-a-html-file – Eugene Kapustin Mar 31 '22 at 15:28
  • 2
    PHP runs on the server, not the client. The browser shouldn't make a difference. – Barmar Mar 31 '22 at 15:51
  • What are the errors you saw? – Barmar Mar 31 '22 at 15:52
  • Perhaps you are trying to use PHP without a web server. As PHP runs on the server side, this is not possible. There are many web servers compatible with PHP, but for a beginner, I would recommend XAMPP, a bundle of programs to help you get started. – CoderCharmander Apr 01 '22 at 06:45
  • @CoderCharmander I have a web server on my client, but I cannot modify it – Velcro Apr 01 '22 at 10:20
  • @Velcro "A web server on my client" doesn't make sense; it's like saying "outside on the inside". And what does "cannot modify it" mean? If it's a case of not having permission to run something, that's not something we can help with, you need to ask whoever can give you that permission. Just loading the PHP in a browser is never going to work. – IMSoP Apr 01 '22 at 16:07

0 Answers0