Mercurial > hg > ywww
view php/read/map/getMapRecommendations.php @ 43:dbc006408d2b
ASSUMES we have SetEnv PHP_VALUE "include_path =.:/var/test/private:/var/test/ywww:/usr/share/php" in apache2/.../test.conf
use dl(...) for debug logging, defined in dlog.php
use doAmazonRequest in amazonBookSearch
use ../private/web.php (q.v., not in mercurial) for Aserver and Aassociates
Started by updating from 40:c24ae74bf6d5, i.e. just before the bug on the main line
| author | Charlie Root |
|---|---|
| date | Sat, 05 Jan 2019 18:00:10 -0500 |
| parents | 077b0a0a3e6d |
| children | 385ddd7c4b55 a67bf725e87b |
line wrap: on
line source
<?PHP if(!isset($ret)) { header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); } //$isbn = $_GET['isbn']; if(isset($_GET['user'])){ $user = $_GET['user']; } if(isset($_GET['listname'])){ $listName = $_GET['listname']; } else{ $listName = "MyMap"; //default location is 1 } if(isset($_GET['loc'])){ $loc = $_GET['loc']; } else{ $loc = 1; //default location is 1 } include "../../../../private/db.php"; $query = "CALL b_getMap_relatedBooks($user,$loc,\"$listName\")"; //echo $query; $results = mysqli_query($link, $query) or exit( mysqli_error( $link )); $output = "<?xml version=\"1.0\"?>"; $output .= "<results>"; while($line = mysqli_fetch_assoc($results)) { $ISBN=trim($line["ISBN"]); $Title = htmlspecialchars($line["Title"]); $Author = htmlspecialchars($line["Author"]); $ImageURL = trim($line["ImageURL"]); $output .= "<BOOK>" ; $output .= "<ISBN>" . $ISBN . "</ISBN>"; $output .= "<Title>" . $Title . "</Title>"; $output .= "<Author>" . $Author . "</Author>"; $output .= "<ImageURL>" . $ImageURL . "</ImageURL>"; $output .= "</BOOK>"; $linkedBooks++; } $output .= "</results>"; if($ret==1) return $output; else echo $output; mysqli_close($link); ?>
