PHP & Content-Security-Policy
| From: | gordonisnz at gmail dot com | Date: | Fri, 17 Sep 2021 08:10:27 +0000 |
| Subject: | PHP & Content-Security-Policy | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-327706@lists.php.net to get a copy of this message | ||
php-general@lists.php.net
Hello. Has anyone got a good tutorial on how to use the
Content-Security-Policy and php example codes ?
I've got 1 code on - but its blocked my own javascript from working :(
i've played with it & now have javascript going - However my google
maps doesn't work.
The map displays - but if you right-click, it should activate another
PHP script & display information - THAt part isn't going & its not
opening up the other php script.
The tutorials ive found only have 1-line examples - but no
combinations of examples.
Do I use them in separate lines ? or in one line ?
Example of what i have (blocks my own javascript):
header("Content-Security-Policy: default-src 'none'");
header("Content-Security-Policy: script-src 'self'");
i'm wanting - To allow simple javascript on my site, and also Google
analytics etc..
has anyone got good php code examples of multiple options ?
so far Ive got this - which seems to work. but doesn't allow me to
open up my 2nd php script.
header("Content-Security-Policy: script-src 'self' 'unsafe-inline'
*.google.com *.googleapis.com");
Is this line correct ?
What i'll like
A) to open up Javascript / SCRIPT comamnds on my own page
B) allow Google maps
C) allow Google analytics.
http://able.kwister.com/map/
(if you select regoon, and service - it should show icons that you can
select. but its not opening up the 2nd div / php script).
--
Gordon.