error_reporting(E_ERROR | E_WARNING | E_PARSE);
$location=$_GET['location'];
$quality=$_GET['quality'];
$spec_loc=$_GET['spec_loc'];
$title=str_replace ( "\\", "", $_GET["location"] );
function escape_space ( $input ) {
return str_replace ( " ","%20", $input);
}
function escape_slash ( $input ) {
return str_replace ( "'", "%5C'", $input);
}
// make our connection
$connection_string = "dbname=joe user=joe host=localhost password='spork22'";
$connection = pg_pconnect($connection_string);
$myresult = "";
$query_string="SELECT * FROM images where location='$location'";
if ($quality != "") $query_string .= " and quality ='$quality'";
if ($spec_loc != "") $query_string .= " and specific_location ='$spec_loc'";
$query_string .= " order by date DESC, id ASC";
$myresult = pg_query ($query_string);
$description_result = pg_exec ( "select description from locations where name='$location'");
$location_description = pg_result ($description_result, 0);
echo "
$title
$location_description";
?>
$align="left";
$iteration="one";
for ($lt = 0; $lt < pg_numrows($myresult); $lt++) {
$id = pg_result($myresult, $lt, 0);
$caption = pg_result($myresult, $lt, 1);
$description = pg_result($myresult, $lt, 2);
$country = rtrim(pg_result($myresult, $lt, 3));
$spec_loc = rtrim(pg_result($myresult, $lt, 4));
$date = pg_result($myresult, $lt, 5);
$photographer = pg_result($myresult, $lt, 6);
$use_for_main = pg_result($myresult, $lt, 7);
$quality = pg_result($myresult, $lt, 8);
$fileext = pg_result($myresult, $lt, 9);
$med_width = pg_result($myresult, $lt, 12);
$med_height = pg_result($myresult, $lt, 13);
$sm_width = pg_result($myresult, $lt, 14);
$sm_height = pg_result($myresult, $lt, 15);
$exposure = pg_result($myresult, $lt, 16);
$aperture = pg_result($myresult, $lt, 17);
$focal = pg_result($myresult, $lt, 18);
$flash = pg_result($myresult, $lt, 19);
$file_loc=escape_space ("https://xenotropic.net/images/{$country}/{$spec_loc}{$id}_med.{$fileext}");
$file_loc=str_replace ( "'", "%5C'", $file_loc );
// echo results
echo "";
echo "";
echo " \n";
echo "$description | \n";
if ( $iteration == "two" ) {
$iteration="one";
echo "\n";
if ( $align=="left" ) { $align="right"; } else { $align="left"; }
} else { $iteration="two"; }
}
?>