Implement MooTools, also improve previous test code.
[csrf-magic.git] / js-test / common.php
blob3cbfad19596e7fbdf09aed90e8e35a02dfccfc57
1 <?php
3 function print_javascript($name, $web) {
4 if (!file_exists($loc = "$name.js")) {
5 $loc = $web;
7 echo '<script src="'.$loc.'" type="text/javascript"></script>';
8 echo '<style>h1 {font-size:12pt;}</style>';
9 return $loc;
12 function csrf_startup() {
13 csrf_conf('rewrite-js', '../csrf-magic.js');
15 require_once '../csrf-magic.php';
17 // Handle an AJAX request
18 if (isset($_POST['ajax'])) {
19 header('Content-type: text/xml;charset=utf-8');
20 echo '<?xml version="1.0" encoding="UTF-8" ?><response>Good!</response>'.PHP_EOL;
21 exit;