require('user.php');
if($_GET['id']=='5'){
//authentification
require("hurt/access.inc.php");
if(($admuser != "") OR ($admmdp != "827ccb0eea8a706c4c34a16891f84e7b")){
session_start();
if($_SESSION["hurt"] == ""){
echo "\n";
session_destroy();
die();
}
elseif($_SESSION["hurt"] != $admuser){
echo "\n";
session_destroy();
die();
}
}
}
// open database connection
$sql = mysql_connect("$host","$user","$pass") or die("error - can't connect to server");
// select database
$dat = mysql_select_db("$db") or die("error - can't connect to db");
// sql query to return data in selected table
$sql_query = ("select * from sale_menu order by id asc");
$row_count = mysql_query($sql_query);
$date = date("Y-m-d");
$id = $_GET['id'];
// get from url
if(isset($_GET['prod'])){
$prod = $_GET['prod'];
}
else{
$prod = '';
}
if(isset($_GET['cat'])){
$cat = $_GET['cat'];
}
else{
$cat = '';
}
if(isset($_GET['of'])){
$of = $_GET['of'];
}
else{
$of = '';
}
if(isset($_GET['prodcat'])){
$prodcat = $_GET['prodcat'];
}
else{
$prodcat = '';
}
// end get from url
include('up.php');
?>
// while records exists to fetch from table, repeat this action
while($line = mysql_fetch_array($row_count)){
// construct a hyperlink from the 2 data elements of record in table
echo '';
if($id==$line[id]){
$podstr = $line[link];
}
elseif($id=='s'){
$podstr = 'search.php';
}
}
?>
| |
//wywołanie funkcji odpowiedzialnej za wyświetlenie zawartości pliku przypisanego do odpowiedniego linku
if(isset($id)){
if(!isset($podstr)){
echo ' Przykro nam - strona, któr± próbujesz wy¶wietlić, nie istnieje.
« powrót | ';
}
elseif(!file_exists($podstr)){
echo ' Przepraszamy - strona, której szukasz, jest w chwili obecnej aktualizowana.
« powrót | ';
}
else{
include($podstr);
}
}
else{
include('promocje.php'); // strona domyślna
}
?>
|
|
include('down.php');
// close result set and connection
mysql_free_result($row_count);
//mysql_close($sql);
?>