I am trying to run the most basic php script from within an html file — I am just running ‘echo 1’ – and nothing is being displayed. Is PhP handling turned off?
How can I run PhP scripts on InfinityFree?
Thank you!
I am trying to run the most basic php script from within an html file — I am just running ‘echo 1’ – and nothing is being displayed. Is PhP handling turned off?
How can I run PhP scripts on InfinityFree?
Thank you!
Hello
Make sure you have done the following:
Added the opening PHP tag at the start of the file
Used the “.php” file extension.
I am using PhP in the html code… that’s possible right?
Here is my code:
PHP Output Example PhP Code output: <?php echo 1; ?>Thanks for replying.
I think there was a formatting issue in that last post:
I guess we can’t past HTML code in these forums…
I just have <?php echo 1;?> in my html code.
To embed HTML in the forum, you need to surround it with “~~~”
So:
~~~ <?php echo 1; ?> ~~~
Did you…
Even if the PHP is within an HTML doc (that’s fine, it’s in spec), you need to use the php file type or the file won’t get sent to the php engine.
Hahahaha — my assumption was that html files could call .php files in the same way that html files call .css files.
I used the file extension and it worked.
Thanks for the information — the engine will only handle .php files (website php code must be in a .php file if one wants php code to be sent to the engine for processing – only .php files get sent off to the processing engine.
So for my project I will put html code in a php file (a file that has the .php extension).
Thank you so much for your time. You really progressed my work.
Good job – I appreciate you very much.
I learned something. !
Have a great day.
I’m having a residual issue —
My php code compilation keeps crashing because I get an error saying that I don’t have permission to access the database I created.
Fatal error: Uncaught mysqli_sql_exception: Access denied for user ‘if0_36807564’@‘192.168.%’ to database ‘counter_db’ in /home/vol16_2/infinityfree.com/if0_36807564/htdocs/test/test.php:14 Stack trace: #0 /home/vol16_2/infinityfree.com/if0_36807564/htdocs/test/test.php(14): mysqli->__construct(‘sql208.infinity…’, ‘if0_36807564’, Object(SensitiveParameterValue), ‘counter_db’) #1 {main} thrown in /home/vol16_2/infinityfree.com/if0_36807564/htdocs/test/test.php on line 14
How do I resolve this issue?
Thanks in advance.
That’s not right. Make sure you are grabbing the correct information from the MySQL page.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.