Modal Pop-Up does not process the PHP code;

michal84
143 Posts
michal84 posted this 02 October 2020
Report a bug

Hello Nicepage support,
I would like to report the issue in Modal Pop-Up when into the Modal is placed the same PHP code as into standard PHP element placed in the empty blank block, where the PHP result is displayed, whilst in the Modal Pop-Up not. The code is shown below:

    <?php
function generateRandomString($length = 10) {
    $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
    $charactersLength = strlen($characters);
    $randomString = '';
    for ($i = 0; $i < $length; $i++) {
        $randomString .= $characters[rand(0, $charactersLength - 1)];
    }
    return $randomString;
}


echo generateRandomString();
?>

The code should just generate the voucher for sale. To get the voucher code in Modal would be expected, however it does not work. The URL is: https://obchod-podlahy.cz/modal.html .
If you have a look to the source code of the displayed page, the PHP is NOT processed - see the attached image.

Thanks for checking that.

Best regards,
Michal

Hello Nicepage support, I would like to report the issue in Modal Pop-Up when into the Modal is placed the same PHP code as into standard PHP element placed in the empty blank block, where the PHP result is displayed, whilst in the Modal Pop-Up not. The code is shown below: <?php function generateRandomString($length = 10) { $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $charactersLength = strlen($characters); $randomString = ''; for ($i = 0; $i < $length; $i++) { $randomString .= $characters[rand(0, $charactersLength - 1)]; } return $randomString; } echo generateRandomString(); ?> The code should just generate the voucher for sale. To get the voucher code in Modal would be expected, however it does not work. The URL is: https://obchod-podlahy.cz/modal.html . If you have a look to the source code of the displayed page, the PHP is NOT processed - see the attached image. Thanks for checking that. Best regards, Michal
Vote to pay developers attention to this features or issue.
6 Replies
Order By: Standard | Newest
simonusher3
28 Posts
simonusher3 posted this 03 October 2020

Hi Michal,

You will need to change the extension .html to .php and it should work. Basically, you cannot run php scripts directly with an .html without modifying the .htaccess on the server, if you wish do this, click on the link below that explains everything.

https://www.thoughtco.com/execute-php-from-a-html-file-2693780

This has come up many times and been requested to allow the choice to export to php or html.

Regards,

Simon..

Hi Michal, You will need to change the extension .html to .php and it should work. Basically, you cannot run php scripts directly with an .html without modifying the .htaccess on the server, if you wish do this, click on the link below that explains everything. https://www.thoughtco.com/execute-php-from-a-html-file-2693780 This has come up many times and been requested to allow the choice to export to php or html. Regards, Simon..
michal84
143 Posts
michal84 posted this 03 October 2020

Hello Simon,
I understand that - but that HTML extension is not made by me, but by RS-SEO component, and the very same code does work properly in any other article (and within the block in such article), so this is not the issue. However I am glad for Your effort.

Best regards,
Michal

Hello Simon, I understand that - but that HTML extension is not made by me, but by RS-SEO component, and the very same code does work properly in any other article (and within the block in such article), so this is not the issue. However I am glad for Your effort. Best regards, Michal
Support Team
Support Team posted this 14 October 2020

Michal,

We have forwarded your issue to the development.

...................................................
Sincerely,
Allen R.
Nicepage Support Team

Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1
Follow us on Facebook: http://facebook.com/nicepageapp

Michal, We have forwarded your issue to the development. ................................................... Sincerely, Allen R. Nicepage Support Team Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1 Follow us on Facebook: http://facebook.com/nicepageapp
michal84
143 Posts
michal84 posted this 14 October 2020

Hello Allen,
perfect. Thanks a lot.

Regards,
Michal

Hello Allen, perfect. Thanks a lot. Regards, Michal
ted.yates
8 Posts
ted.yates posted this 06 December 2021

Hi Michal,

You will need to change the extension .html to .php and it should work. Basically, you cannot run php scripts directly with an .html without modifying the .htaccess on the server, if you wish do this, click on the link below that explains everything.

https://www.thoughtco.com/execute-php-from-a-html-file-2693780

This has come up many times and been requested to allow the choice to export to php or html.

Regards,

Simon..

If nicepage does not work without exporting to PHP and that has been requested many times, why hasn't it been fixed?

> Hi Michal, > > You will need to change the extension .html to .php and it should work. Basically, you cannot run php scripts directly with an .html without modifying the .htaccess on the server, if you wish do this, click on the link below that explains everything. > > https://www.thoughtco.com/execute-php-from-a-html-file-2693780 > > This has come up many times and been requested to allow the choice to export to php or html. > > Regards, > > Simon.. If nicepage does not work without exporting to PHP and that has been requested many times, why hasn't it been fixed?
michal84
143 Posts
michal84 posted this 06 December 2021

Hello Simon,
thanks for your idea, however this is not the way expected, because the google or any other search engine would recognize the same page with PHP or HTML as duplicate contents (even on the same domain). Because of SEO, this is not the way I would like to go. When there is an option to insert the code of HTML, I would expect to allow also insert own PHP code instead. As previously mentioned, I do have already optimized sites, and the way You have advised would have a negative impact unfortunately.

Best regards,
Michal

Hello Simon, thanks for your idea, however this is not the way expected, because the google or any other search engine would recognize the same page with PHP or HTML as duplicate contents (even on the same domain). Because of SEO, this is not the way I would like to go. When there is an option to insert the code of HTML, I would expect to allow also insert own PHP code instead. As previously mentioned, I do have already optimized sites, and the way You have advised would have a negative impact unfortunately. Best regards, Michal
You must log in or register to leave comments