Created
June 28, 2017 16:07
-
-
Save akakiev/1311b27806baa7effeccf1daa44ee30e to your computer and use it in GitHub Desktop.
Desserts_PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
body {background: #faeedd; | |
color: #B22222} | |
h1 {font: 40px Wingding; | |
color: #DB7093; | |
font-weight: bold; | |
font-style: italic; | |
padding: 30px 0px 0px 90px;} | |
h2 {font: 20px Wingding; | |
color: #DB7093; | |
font-style: italic; | |
padding-left: 90px;} | |
h3 {font: 24px Georgia; | |
font-weight: bold; | |
padding: 30px 0px 0px 60px;} | |
h4 {font: 18px Georgia; | |
font-weight: bold; | |
text-indent: 30px;} | |
p {font: 18px Georgia; | |
text-align: justify; | |
text-indent: 30px;} | |
ul {font: 18px Georgia; | |
text-align: justify;} | |
#text {padding: 0px 30px 100px 30px;} | |
#logo {width: 15%; | |
font: 50px Monotype Corsiva; | |
letter-spacing: 1px; | |
height: 10px; | |
color: #BC8F8F; | |
font-weight: 900; | |
text-shadow: 2px 2px 5px #F08080; | |
padding: 10px 10px 20px 10px} | |
#menu {height: 10px; | |
padding: 10px 10px 15px 10px} | |
#menu a {display: block; | |
text-decoration: none; | |
font: 20px Georgia; | |
color: #B22222; | |
padding-bottom: 10px} | |
#menu a:hover {color: #DB7093; | |
font-weight: 900;} | |
#go {padding: 40px 10px 15px 10px} | |
#go a {display: block; | |
text-decoration: none; | |
width: 40px; | |
float: left; | |
margin-left: 10px} | |
#go a:hover {box-shadow: 0px 0px 10px #F08080} | |
#go a.activ {border: 3px solid #F08080;} | |
#foto {width: 35%; | |
margin: 30px 0px 30px 30px; | |
box-shadow: 0px 0px 30px #F08080} | |
</style> | |
<link rel='icon' href='cake.ico'> | |
<title>Лучшие десерты мира</title> | |
<body> | |
<? | |
include "start.php"; | |
$logo="Лучшие десерты мира"; | |
$go_ua="https://upload.wikimedia.org/wikipedia/commons/thumb/4/49/Flag_of_Ukraine.svg/800px-Flag_of_Ukraine.svg.png"; | |
$go_ru="http://mkrada.gov.ua/files/flags/russia_small_flag.gif"; | |
$tab=mysql_query("SELECT * FROM `dessert`"); | |
for($i=1;$i<=mysql_num_rows($tab);$i++) | |
{ | |
$row=mysql_fetch_array($tab); | |
$name[$i]=$row['name_ru']; | |
$photo[$i]=$row['photo']; | |
$text[$i]=$row['text_ru']; | |
$country[$i]=$row['country_ru']; | |
$flag[$i]=$row['flag']; | |
$id[$i]=$row['id']; | |
} | |
if ($_GET) | |
{ | |
$n=$_GET['n']; | |
}else{ | |
$n=$id[1]; | |
} | |
echo "<table width='100%' border='0'>"; | |
echo "<tr>"; | |
echo "<td valign='top' id='logo'>"; | |
echo $logo; | |
echo "</td>"; | |
echo "<td rowspan='3' valign='top' id='text'>"; | |
echo "<img src='$photo[$n]' align='right' id='foto'>"; | |
echo "<h1>".$name[$n]."</h1>"; | |
echo "<h2>".$country[$n]." <img src='$flag[$n]' align='bottom' width='20'></h2>"; | |
echo $text[$n]."<br>"; | |
echo "</td>"; | |
echo "</tr>"; | |
echo "<tr>"; | |
echo "<td valign='top' id='menu'>"; | |
for ($i=1; $i<=count($name);$i++) | |
{ | |
echo "<a href='dessert_ru.php?n=$i'>".$name[$i]."</a>"; | |
} | |
echo "</td>"; | |
echo "</tr>"; | |
echo "<tr>"; | |
echo "<td valign='top' id='go'>"; | |
echo "<a href='dessert_ua.php?n=$n'><img src='$go_ua' align='bottom' width='40'></a> <a href='dessert_ru.php?n=$n' class='activ'><img src='$go_ru' align='bottom' width='40'></a>"; | |
echo "</td>"; | |
echo "</tr>"; | |
echo "</table>"; | |
?> | |
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
body {background: #faeedd; | |
color: #B22222} | |
h1 {font: 40px Wingding; | |
color: #DB7093; | |
font-weight: bold; | |
font-style: italic; | |
padding: 30px 0px 0px 90px;} | |
h2 {font: 20px Wingding; | |
color: #DB7093; | |
font-style: italic; | |
padding-left: 90px;} | |
h3 {font: 24px Georgia; | |
font-weight: bold; | |
padding: 30px 0px 0px 60px;} | |
h4 {font: 18px Georgia; | |
font-weight: bold; | |
text-indent: 30px;} | |
p {font: 18px Georgia; | |
text-align: justify; | |
text-indent: 30px;} | |
ul {font: 18px Georgia; | |
text-align: justify;} | |
#text {padding: 0px 30px 100px 30px;} | |
#logo {width: 15%; | |
font: 50px Monotype Corsiva; | |
letter-spacing: 1px; | |
height: 10px; | |
color: #BC8F8F; | |
font-weight: 900; | |
text-shadow: 2px 2px 5px #F08080; | |
padding: 10px 10px 20px 10px} | |
#menu {height: 10px; | |
padding: 10px 10px 15px 10px} | |
#menu a {display: block; | |
text-decoration: none; | |
font: 20px Georgia; | |
color: #B22222; | |
padding-bottom: 10px} | |
#menu a:hover {color: #DB7093; | |
font-weight: 900;} | |
#go {padding: 40px 10px 15px 10px} | |
#go a {display: block; | |
text-decoration: none; | |
width: 40px; | |
float: left; | |
margin-left: 10px} | |
#go a:hover {box-shadow: 0px 0px 10px #F08080} | |
#go a.activ {border: 3px solid #F08080;} | |
#foto {width: 35%; | |
margin: 30px 0px 30px 30px; | |
box-shadow: 0px 0px 30px #F08080} | |
</style> | |
<link rel='icon' href='cake.ico'> | |
<title>Найкращі десерти світу</title> | |
<body> | |
<? | |
include "start.php"; | |
$logo="Найкращі десерти світу"; | |
$go_ua="https://upload.wikimedia.org/wikipedia/commons/thumb/4/49/Flag_of_Ukraine.svg/800px-Flag_of_Ukraine.svg.png"; | |
$go_ru="http://mkrada.gov.ua/files/flags/russia_small_flag.gif"; | |
$tab=mysql_query("SELECT * FROM `dessert`"); | |
for($i=1;$i<=mysql_num_rows($tab);$i++) | |
{ | |
$row=mysql_fetch_array($tab); | |
$name[$i]=$row['name_ua']; | |
$photo[$i]=$row['photo']; | |
$text[$i]=$row['text_ua']; | |
$country[$i]=$row['country_ua']; | |
$flag[$i]=$row['flag']; | |
$id[$i]=$row['id']; | |
} | |
if ($_GET) | |
{ | |
$n=$_GET['n']; | |
}else{ | |
$n=$id[1]; | |
} | |
echo "<table width='100%' border='0'>"; | |
echo "<tr>"; | |
echo "<td valign='top' id='logo'>"; | |
echo $logo; | |
echo "</td>"; | |
echo "<td rowspan='3' valign='top' id='text'>"; | |
echo "<img src='$photo[$n]' align='right' id='foto'>"; | |
echo "<h1>".$name[$n]."</h1>"; | |
echo "<h2>".$country[$n]." <img src='$flag[$n]' align='bottom' width='20'></h2>"; | |
echo $text[$n]."<br>"; | |
echo "</td>"; | |
echo "</tr>"; | |
echo "<tr>"; | |
echo "<td valign='top' id='menu'>"; | |
for ($i=1; $i<=count($name);$i++) | |
{ | |
echo "<a href='dessert_ua.php?n=$i'>".$name[$i]."</a>"; | |
} | |
echo "</td>"; | |
echo "</tr>"; | |
echo "<tr>"; | |
echo "<td valign='top' id='go'>"; | |
echo "<a href='dessert_ua.php?n=$n' class='activ'><img src='$go_ua' align='bottom' width='40'></a> <a href='dessert_ru.php?n=$n'><img src='$go_ru' align='bottom' width='40'></a>"; | |
echo "</td>"; | |
echo "</tr>"; | |
echo "</table>"; | |
?> | |
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
$host="localhost"; | |
$login=""; | |
$pas=""; | |
$db=""; | |
$connect=mysql_connect($host,$login,$pas); | |
if(!$connect) | |
{ | |
exit("<h1>Не має доступу до бази даних, помилка!!!</h1>"); | |
} | |
$select=mysql_select_db($db,$connect); | |
if(!$select) | |
{ | |
exit("<h1>Не можливо вибрати базу даних</h1>"); | |
} | |
mysql_query("SET NAMES 'utf8'"); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment