-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathpiwigo-random-demo-php.php
More file actions
34 lines (30 loc) · 1.38 KB
/
piwigo-random-demo-php.php
File metadata and controls
34 lines (30 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Random images demo</title>
</head>
<body>
<p>Piwigo RANDOM demo, without JavaScript. See <a
href="https://github.com/moy/piwigo-random">https://github.com/moy/piwigo-random</a>
for details.</p>
<h1>Using file_get_content</h1>
<p>You need to trust the server hosting the backend, as it can inject any HTML, including JavaScript code, in your page. Typically, the backend and your website can run on the same server.</p>
<p>This
<?php $base_url = "http://matthieu-moy.fr/piwigo-random/piwigo-random-backend.php";
echo file_get_contents($base_url . "?mode=html&cat_id=13"); ?>
is a random image</p>
<h1>Using file_get_content and setting the target</h1>
<p>You need to trust the server hosting the backend, as it can inject any HTML, including JavaScript code, in your page. Typically, the backend and your website can run on the same server.</p>
<p>This
<?php $base_url = "http://matthieu-moy.fr/piwigo-random/piwigo-random-backend.php";
echo file_get_contents($base_url . "?mode=html&target=_self"); ?>
is a random image</p>
<div id="validator">
<a href="http://validator.w3.org/check?uri=referer">
<img src="http://www.w3.org/html/logo/downloads/HTML5_Logo_64.png"
alt="Valid HTML" height="64" width="64" />
</a>
</div>
</body>
</html>