Ticket #6229: test.php

File test.php, 1.9 KB (added by zerointeger, 11 years ago)

Test case demonstrating broken cookie, ajax initial page load

Line 
1<?php
2switch($_GET['do']) {
3 case '0x00a0':
4  echo 'test-a.html';
5 case '0x00b0':
6  echo 'test-b.html';
7 case '0x00c0':
8  echo 'test-c.html';
9 case '0x00d0':
10  echo 'test-d.html';
11 case '0x00e0':
12  echo 'test-e.html';
13 case '0x00f0':
14  echo 'test-f.html';
15 default:
16  echo 'test-a.html';
17}
18?>
19<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
20<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
21 <head>
22  <link rel="stylesheet" type="text/css" href="templates/default/css/overcast/jquery-ui-1.8.5.custom.css" />
23  <link rel="stylesheet" type="text/css" href="templates/default/css/default.css" />
24  <script type="text/javascript" src="libs/js/jquery-1.4.3.min.js"></script>
25  <script type="text/javascript" src="libs/js/jquery-ui-1.8.5.custom.min.js"></script>
26  <script type="text/javascript" src="libs/js/jquery.cookie.js"></script>
27  <script type="text/javascript">
28   var $j = jQuery.noConflict();
29   $j(document).ready(function() {
30    var loading = '<img src="templates/default/images/loading.gif" width="20" height="20" alt="Loading content..." title="Loading content..." />';
31    var tabID = $j.cookie('tabID')||0;
32    $j('#tabs').tabs({
33     rotate: 0,
34     ajaxOptions: [{async:true,cache:true}],
35     fx: [{opacity:'toggle',height: 'toggle',duration:'normal'}],
36     selected: tabID,
37     show: function(junk, ui) {
38      $j.cookie('tabID', ui.index, {expires:3600});
39     },
40     spinner: loading
41    });
42   });
43  </script>
44 </head>
45 <body>
46  <div id="tabs" class="tabs">
47   <ul id="tabID">
48    <li><a href="content.php?do=0x00a0">Main</a></li>
49    <li><a href="content.php?do=0x00b0">Purchasing</a></li>
50    <li><a href="content.php?do=0x00c0">Inventory</a></li>
51    <li><a href="content.php?do=0x00d0">Reports</a></li>
52    <li><a href="content.php?do=0x00e0">Options</a></li>
53    <li><a href="content.php?do=0x00f0">Exit</a></li>
54   </ul>
55  </div>
56 </body>
57</html>