Simple PHP scripts doesn't work

Nimmimonie
edited November -1 in Support Forums

Hello.

Got a little problem. I have a simple PHP script inserted in an HTML file. I just noticed it doesn't work here. The script is just a simple counter, it counts and displays the number of views of a particular HTML page. In the previous free hosting site I've been to, the PHP code works inside the HTML page. But here, it doesn't. How come? How can I make a PHP code work inside an HTML file here?

Thanks.

Comments

  • Admin
    edited November -1

    Hello.

    Got a little problem. I have a simple PHP script inserted in an HTML file. I just noticed it doesn't work here. The script is just a simple counter, it counts and displays the number of views of a particular HTML page. In the previous free hosting site I've been to, the PHP code works inside the HTML page. But here, it doesn't. How come? How can I make a PHP code work inside an HTML file here?

    Thanks.

    It is not a hosting problem. It should work here if it did before. It'll be really helpful if you show the code you are trying to run.

    In general, you should make sure that file is saved as ".php" not ".html" and that there are no syntax errors.

  • Nimmimonie
    edited November -1

    Thanks. Already figured that out after doing some searching on the web. Unfortunately, I cannot rename the HTML files into PHP because of the too much work it will cost when testing the pages on my PC. Luckily, the PHP counter I've installed works here but not on the other free hosting site I was using before.

    By the way, I also noticed audio streaming is not possible here so I just hosted the files on Google Drive.

  • Quaxth
    edited November -1

    Why didn't you use a local server on your computer for to test your PHP Apps etc.? I use AMPPS (http://ampps.com) for that and it just works excellent! Beside of that, AMPPS come with all the Scripts of Softaculous (more than 300!), and it's FREE!