Recently, my website doesn't move to the selected page when clicked on the menu. It was working fine before, and I didn't change anything, so I don't know what causes this issue. It was designed to move to galleries showing images of artworks when clicked on the menu shown on the left. It's currently showing only the first gallery even though I click the button on the menu to see other galleries. [www.hyunsoooh.com][1]
The main php file is below. Any help appreciated. My apology if this question is duplicated, but I have searched for the similar issues many times before I post this question.
<?php
$localhost="localhost";
$mysqluser="zw8ttp5_uhyunso_";
$mysqlpwd="masterpainter";
$mysqldb="zw8ttp5_hyunsooohcom_445635_db1";
$gallery = $HTTP_GET_VARS["gallery"];
$page = $HTTP_GET_VARS["page"];
if ($page=="") $page = "gallery" ;
if ($gallery=="") $gallery = 14 ;
// Creating a database connection
$connection = mysqli_connect($localhost, $mysqluser, $mysqlpwd);
if (!$connection) {
die("Database connection failed: " . mysqli_connect_error());
}
// Selecting a database
$db_select = mysqli_select_db($connection, $mysqldb);
if (!$db_select) {
die("Database selection failed: " . mysqli_connect_error());
}
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>HYUN SOO OH</title>
<link type="text/css" rel="stylesheet" href="style.css" />
<!-- SHADOWBOX -->
<link rel="stylesheet" type="text/css" href="shadowbox/shadowbox.css">
<script type="text/javascript" src="shadowbox/shadowbox.js"></script>
<script type="text/javascript">
Shadowbox.init({
overlayColor: ["#a1a182"],
overlayOpacity: [1.0],
viewportPadding: [20],
players: ["img", "qt", "iframe"]
});
</script>
<!-- SHADOWBOX -->
</head>
<body>
<div id="framecontent">
<div class="leftwrapper">
<h1><a href="http://www.hyunsoooh.com"><img src="images/hyunsoooh.jpg" alt="Hyun Soo Oh" /></a></h1>
<h2>About Me</h2>
<ul>
<?php
if ($page=="about")
{
?>
<li class="selected">BIO</li>
<?php
}
else
{
?>
<li><a class="navlink" href="?page=about">BIO</a></li>
<?php
}
if ($page=="contact")
{
?>
<li class="selected">Holla @ Me</li>
<?php
}
else
{
?>
<li><a class="navlink" href="?page=contact">Holla @ Me</a></li>
<?php
}
?>
</ul>
<h2>Works</h2>
<ul>
<?php
// GET GALLERY NAVIGATION
$sql = "SELECT GalleryID, Name, Description FROM galleries ORDER BY OrderNumber ASC";
$result = mysqli_query($connection, $sql);
while (list ($gal_ID, $gal_name, $gal_desc) = mysqli_fetch_row($result))
{
if ($page=="gallery" && $gallery==$gal_ID)
{
?>
<li class="selected"><?php echo $gal_name ;?></li>
<?php
}
else
{
echo "<li>";
echo "<a class=\"navlink\" href=\"?page=gallery&gallery=";
echo $gal_ID;
echo "\">";
echo $gal_name;
echo "</a></li>";
}
}
if ($page=="links")
?>
</ul>
</div>
</div>
<div id="maincontent">
<div class="wrapper">
<?php
if ($page=="gallery" && $gallery != "")
{
// ÜBERSCHRIFT LADEN
$sql = "SELECT Name, Description FROM galleries WHERE GalleryID = $gallery";
$result = mysqli_query($connection, $sql);
list ($gal_name, $gal_desc) = mysqli_fetch_row($result);
echo "<p><h1>" . $gal_name . "</h1><br><h2>" . $gal_desc . "</h2></p>";
// BILDER LADEN
$sql = "SELECT PictureID, BelongsToGallery, Name, Description, Filename, Filetype, VideoWidth,
VideoHeight FROM pictures WHERE BelongsToGallery = $gallery ORDER BY OrderNumber ASC";
$result = mysqli_query($connection, $sql);
?>
<table width="100%" border=0><tr>
<?php
// MAIN LOOP
$i = 0;
while (list ($picID, $galleryID, $name, $desc, $file, $type, $video_width, $video_height) =
mysqli_fetch_row($result))
{
if ($i==2)
{
$i = 0;
echo "</tr><tr>";
}
if ($type == "IMG")
{
echo "<td>";
echo "<a href=\"" . "gallery/" . $galleryID . "/" . $file . "\" rel=\"shadowbox["
. $galleryID . "]\" title=\"" . $name . "\"><img src=\"thumbs/" . $galleryID .
"/" . $file . "\"></a><br>\n" . "<p><strong>" . $name . "</strong></p><p>" .
$desc . "</p></td>";
}
if ($type == "MOV")
{
echo "<td>";
echo "<a href=\"" . "gallery/" . $galleryID . "/" . $file . "\" rel=\"shadowbox["
. $galleryID . "-mov];height=" . $video_height . ";width=" . $video_width . "\"
title=\"" . $name . "\"><img src=\"thumbs/" . $galleryID . "/" . $file . ".jpg\">
</a><br>\n" . "<p><strong>" . $name . "</strong></p><p>" . $desc . "</p></td>";
}
if ($type == "YOUTUBE")
{
echo "<td>";
echo "<a href=\"http://www.youtube.com/v/" . $file . "\" rel=\"shadowbox[" .
$galleryID . "-yt]\" title=\"" . $name . "\"><img src=\"thumbs/" . $galleryID .
"/" . $file . ".jpg\"></a><br>\n" . "<p><strong>" . $name . "</strong></p><p>" .
$desc . "</p></td>";
}
$i++;
}
?>
</tr></table>
<?php
}
Aucun commentaire:
Enregistrer un commentaire