I have created a PHP page and added a HTML snippet bric with the following code;
<?php
echo "Some text!";
?>
Preview in browser shows a blank page. Same result on the webpage arina.biz/phptest.php
Am I doing something basically wrong or is this feature broken. thanks - much appreciated of any feedback.
You can’t preview php with the Blocs preview in browser, it’s pretty basic and does not run a local server or php so it’s basically not rendering it. Use MAMP or some other tool to setup a local php server and then load your page via that local host.
Thanks Norm - I have the page running live on my web server ( which runs php) and all I get is a blank page ( plus my header/footer). Arina.biz/phptest
Im afraid I dont understand your other instructions
cheers John
Well that is encouraging that it is working ( at your end) - it is definitely published at https://arina.biz/phptest
The site only has an index.html - no index.php
So just to backup a bit.
This is frustrating. I have looked in the actual php file there is an error in the conversion as there is no space between php and echo. If I manually add one the page works. I should add the whole of the file was expressed in a single line.
<?phpecho 'some text!';?><p>A PHP snippet should be visible above</p><
The current webpage has the error corrected.
I certainly have the page set to php (as it wouldn’t generate the php file otherwise). I have also deleted the bloc and re-added a new one and the html widget.
Yep, it looks like autominimize feature has removed all spaces & maybe even a return.
Just to verify did you type the first line as ‘<?php’ & then hit return? & then other code on next lines…
I don’t think minimize will remove returns, which would maybe fix the problem.
Let us know.