Browse Source

generate self-referencing script URI correctly, taking into account that the

script might be content-negotiated, renamed, symlinked, or otherwise
alised in URI-space.
tags/v0.99.beta17
Ben Wiley Sittler bsittler 16 years ago
parent
commit
ec5aa385a4
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      caca-php/examples/www/render.php

+ 4
- 1
caca-php/examples/www/render.php View File

@@ -38,6 +38,9 @@ if (isset($_GET["png"])) {
imagepng($img); imagepng($img);
} }
else { else {

$render_php = isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] : 'render.php';

?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


@@ -53,7 +56,7 @@ else {
<?echo caca_export_string(pig(), "html3");?> <?echo caca_export_string(pig(), "html3");?>


<h1>Generated image:</h1> <h1>Generated image:</h1>
<a href="render.php?png=1"><img alt="[PNG]" src="render.php?png=1" border="0" /></a>
<a href="<?= htmlspecialchars($render_php) ?>?png=1"><img alt="[PNG]" src="<?= htmlspecialchars($render_php) ?>?png=1" border="0" /></a>
</body> </body>
</html> </html>




Loading…
Cancel
Save