}
        echo "{$data}";
    }
    exit;
}
//********************
// This is an Ajax call.
// Gets the "subject" and "description"
// The arguments are:
// info=id
// returns an echoed string like this:
// "<::subject::>subject info<::description::>>description info"
// this string can be parsed to get the subject and description.
if ($id = $_GET['info']) {
    Header("Content-type: text/plain");
    $data = $ss->getInfo($id);
    echo "<::subject::>{$data['subject']}<::description::>{$data['description']}";
    exit;
}
//********************
// This is an Ajax call.
// Get the list of ids
// ids=1
// where=where arguments. optional
// returns the list of ids
if ($_GET['ids']) {
    Header("Content-type: text/plain");
    $ar = $ss->GetImageIds($_GET['where']);
    error_log("AR: " . print_r($ar, true));
    $ids = "";
    foreach ($ar as $id) {
示例#2
0
    if (!$isIe) {
        $images = $_SESSION['images'];
        // getImage() returns an assoc array ['data'], ['mime'], ['subject'], and ['desc']
        // ['data'] is base64 by default. If a second argument is provided as 'raw' then the data is the raw image data.
        $data = $images[$inx++];
        $_SESSION['index'] = $inx > count($ids) - 1 ? 0 : $inx;
        $image = $data['data'];
        // image in base64
        $mime = $data['mime'];
        // mime type like "image/gif" etc.
        $subject = $data['subject'];
        $desc = $data['desc'];
    } else {
        // Handle BROKEN Browser!
        $image = "mysqlslideshow.php?image={$ids[$inx]}&type=raw";
        $info = $ss->getInfo($ids[$inx++]);
        $_SESSION['index'] = $inx > count($ids) - 1 ? 0 : $inx;
        $subject = $info['subject'];
        $desc = $info['description'];
    }
    echo <<<EOF
<html>
<head>
  <title>Slideshow Example: Server Side Version</title>
  <!-- Set Refresh for every 5 seconds -->
  <meta http-equiv="Refresh" content="5"; url="http://localhost/test.php" />
</head>
<body>
<h1>Slide Show Example: Server Side Version</h1>
{$ieMsg}
<form action="{$self}" method="post">