Expecting "This is Sample PHP" to be displayed on the..."> Expecting "This is Sample PHP" to be displayed on the...">

PHP feature

Mr LH
7 Posts
Mr LH posted this 08 April 2019
Ask a Question

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

I am using the PHP code snippet! as per example: &lt;?php?&gt; 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
Vote to pay developers attention to this features or issue.
12 Replies
Order By: Standard | Newest
Support Team
Support Team posted this 08 April 2019

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

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
Mr LH
7 Posts
Mr LH posted this 08 April 2019

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?
magann
39 Posts
magann posted this 08 April 2019

You have an extra ?> added should be

<?php echo "this is sample php";?>

You have an extra ?> added should be &lt;?php echo &quot;this is sample php&quot;;?&gt;
Mr LH
7 Posts
Mr LH posted this 08 April 2019

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 &quot;Sample PHP&quot;;

?><!--/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 &quot;Sample PHP&quot;; ?>&lt;!--/custom_php--&gt;" 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
magann
39 Posts
magann posted this 10 April 2019

Nicepage 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

enter image description here

Not here

enter image description here
Nicepage 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 ![enter image description here][1] Not here ![enter image description here][2] [1]: http://mistergoodweb.com/classshouldbehere.gif [2]: http://mistergoodweb.com/classshouldnotbehere.gif
Mr LH
7 Posts
Mr LH posted this 10 April 2019

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.
Support Team
Support Team posted this 11 April 2019

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

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
weblinker
20 Posts
weblinker posted this 28 October 2019

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)

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

tony62
32 Posts
tony62 posted this 05 October 2020

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.
lu8ino
9 Posts
lu8ino posted this 09 January 2021

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

> 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
magann
39 Posts
magann posted this 10 January 2021

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.

code execute
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. ![code execute][1] [1]: http://mrgoodweb.com/codeexecuting.gif

Last edited 10 January 2021 by magann

shizzart90
6 Posts
shizzart90 posted this 22 December 2022

two years later and where we are... ?? Come on, update it!

two years later and where we are... ?? Come on, update it!
You must log in or register to leave comments