![Ask a Question Ask a Question](/Content/Images/Site/post-type-question.png)
I am using the PHP code snippet! as per example:
<?php?> echo "This is Sample PHP";
?>
Expecting "This is Sample PHP" to be displayed on the screen... but nothing happens!! What am I missing?
Thanks for the assistance
Luis
Expecting "This is Sample PHP" to be displayed on the..."> Expecting "This is Sample PHP" to be displayed on the...">
I am using the PHP code snippet! as per example:
<?php?> echo "This is Sample PHP";
?>
Expecting "This is Sample PHP" to be displayed on the screen... but nothing happens!! What am I missing?
Thanks for the assistance
Luis
Hi Luis,
The code will be rendered fine after the export of the theme. We do not process such code within the application.
...................................................
Sincerely,
Hella
Nicepage Support Team
Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1
Follow us on Facebook: http://facebook.com/nicepageapp
Sorry... but it not clear what this PHP snippet Does!
I have Exported a static HTML site/page and still nothing is displayed!
Essentially, what I would like to do is to display dynamic content - using php script into a container in the page. Is this possible?
Sorry... but it not clear what this PHP snippet Does! I have Exported a static HTML site/page and still nothing is displayed! Essentially, what I would like to do is to display dynamic content - using php script into a container in the page. Is this possible?You have an extra ?> added should be
<?php echo "this is sample php";?>
You have an extra ?> added should be <?php echo "this is sample php";?>Thanks "magnan" for spotting my error!
Anyway, the issue is not resolved! After inserting the PHP snippet... this is how it shows in the exported index.html:
<section class="u-clearfix u-section-1" id="sec-da42">
<div class="u-clearfix u-sheet u-sheet-1">
<div data-custom-php="<!--custom_php--><?php
echo "Sample PHP";
?><!--/custom_php-->" class="u-custom-php u-custom-php-1">
</div>
</section>
Again, as I said before... this does not output "Sample PHP" on the screen!
Thanks
Thanks "magnan" for spotting my error! Anyway, the issue is not resolved! After inserting the PHP snippet... this is how it shows in the exported index.html: <section class="u-clearfix u-section-1" id="sec-da42"> <div class="u-clearfix u-sheet u-sheet-1"> <div data-custom-php="<!--custom_php--><?php echo "Sample PHP"; ?><!--/custom_php-->" class="u-custom-php u-custom-php-1"> </div> </section> Again, as I said before... this does not output "Sample PHP" on the screen! ThanksNicepage is not rendering it correctly It split the div data-custom-php= with the class element. Also I think you may need to save it as php instead of html
SHOULD BE HERE
Not here
Thanks magann!
Your comments make sense. We agree that the PHP snippet implementation is flawed... The NicePage development team should take this issue as a BUG and take steps to fix it!
Many thanks for ypur interest on this matter.
Thanks once again.
Thanks magann! Your comments make sense. We agree that the PHP snippet implementation is flawed... The NicePage development team should take this issue as a BUG and take steps to fix it! Many thanks for ypur interest on this matter. Thanks once again.Hi Luis,
I didn't know that you are using the HTML export. PHP control is only for the WP and Joomla exports. The simple HTML page cannot render the PHP code.
...................................................
Sincerely,
Hella
Nicepage Support Team
Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1
Follow us on Facebook: http://facebook.com/nicepageapp
Renaming the index.html (or whatever your file name is) into index.php it will work I guess...
And as well PHP is server side language you should upload on a server to see it working (or use XAMPP if you want to see working in local)
Last edited 28 October 2019 by weblinker
Hi,
Simple html can be usd to render php if you adjust your web server to parse html files as php.
Renaming the html file to php will not work correctly as NicePage mangles the php code.
Open one of the html files and look for conversion of " to html codes.
Insert your php source in a NicePage object. Export the site then edit the html files
with php embedded. Remove the code bounded by the NicePage div data-custom-php
insert your own working raw php code bounded by a div.
Voila, php operating correctly in html site/page.
I have several pages extracting data from a mysql server using this method.
Hope this helps.
Hi, Simple html can be usd to render php if you adjust your web server to parse html files as php. Renaming the html file to php will not work correctly as NicePage mangles the php code. Open one of the html files and look for conversion of " to html codes. Insert your php source in a NicePage object. Export the site then edit the html files with php embedded. Remove the code bounded by the NicePage div data-custom-php insert your own working raw php code bounded by a div. Voila, php operating correctly in html site/page. I have several pages extracting data from a mysql server using this method. Hope this helps.Hi,
Simple html can be usd to render php if you adjust your web server to parse html files as php.
Renaming the html file to php will not work correctly as NicePage mangles the php code.
Open one of the html files and look for conversion of " to html codes.
Insert your php source in a NicePage object. Export the site then edit the html files
with php embedded. Remove the code bounded by the NicePage div data-custom-php
insert your own working raw php code bounded by a div.
Voila, php operating correctly in html site/page.
I have several pages extracting data from a mysql server using this method.Hope this helps.
HI, I have tried that , but something is still missing. Do I need to to setup something else so PHP code will be run ?
Can you give me some example ?
Regards,
Lubo
Ironically if you look at the very top of this page that it is actually writing "Expecting "This is Sample PHP" to be displayed on the...Expecting "This is Sample PHP" to be displayed on the..." at the very top of the screen. Don't think it's a good idea that you can execute code on your server through commenting.
Last edited 10 January 2021 by magann
two years later and where we are... ?? Come on, update it!
two years later and where we are... ?? Come on, update it!