Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- global $status;
- $host = 'localhost';
- $user = 'klient1';
- $pass = 'fanfilmow';
- $db = 'bazadanych';
- $polaczenie = new mysqli($host,$user,$pass,$db);
- if($polaczenie->connect_errno > 0){
- die('Unable to connect to database [' . $polaczenie->connect_error . ']');
- $status = 'false';
- }else{
- $status = 'true';
- }
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <title>Połączenie z bazą danych</title>
- <link rel="stylesheet" href="style.css" type="text/css">
- <meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
- <style>
- body{
- text-align: center;
- margin:0;
- padding:0;
- color:red;
- }
- li{
- display:inline-block;
- background-color:red;
- margin:5px;
- }
- a{
- color:#333333;
- margin:5px;
- }
- a:hover{
- color:red;
- margin:5px;
- }
- li:hover{
- background-color:#333333;
- }
- #box{
- }
- #top{
- background-color:#333333;
- height:50px;
- }
- #menu{
- background-color: #333333;
- height:50px;
- }
- #content{
- background-color:#333333;
- height:350px;
- margin-top:5px;
- }
- #footer{
- background-color: #333333;
- height:50px;
- margin-top:5px;
- }
- </style>
- </head>
- <body>
- <div id="box">
- <div id="top">
- LOGO
- </div>
- <div id="menu">
- <ul>
- <li><a target="_black" href="www.google.com">GOOGLE</a></li>
- <li><a target="_black" href="www.facebook.com">FACEBOOK</a></li>
- <li><a target="_black" href="www.darkwarez.pl">DARKWAREZ</a></li>
- </ul>
- </div>
- <div id="content">
- Połączenie z bazą danych: <?php echo $status; ?><br><br><br><BR>
- <form action='' method='post'>
- <input type="text" size="200" value="wprowadź zapytanie"/><br>
- <button type="submit">WYKONAJ ZAPYTANIE</button>
- </form>
- </div>
- <div id="footer">
- webmaster © Damian Sieczko
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement