Html için
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title></title> <meta name="description" content=""/> <meta name="description" content="" /> <meta name="keywords" content="" /> <meta property="og:locale" content="tr_TR" /> <meta property="og:type" content="" /> <meta property="og:title" content="" /> <meta property="og:description" content="" /> <meta property="og:url" content="" /> <meta property="og:site_name" content="" /> <meta name="twitter:card" content="" /> <meta name="twitter:description" content="" /> <meta name="twitter:title" content="" /> <meta name="twitter:site" content="@" /> <link rel="amphtml" href="" /> <link rel="icon" type="image/x-icon" href="favicon.ico" /> <link rel="canonical" href="" /> <link rel="next" href="" /> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css"> <style type='text/css'></style> </head> <body> <div class="container-fluid"></div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.bundle.min.js"></script> <script type="text/javascript"></script> </body> </html>
Php için
<?php ob_start(); session_start(); header("Cache-Control: no-cache, must-revalidate"); header('Content-Type: text/html; charset=utf-8'); date_default_timezone_set('Europe/Istanbul'); mb_language('uni'); mb_internal_encoding('UTF-8'); if($_SERVER['HTTP_HOST'] == "127.0.0.1"){ //localhost $link = mysqli_connect("localhost","root","rootsifre","dbadi"); }else{ //www global $link = mysqli_connect("localhost","kullaniciadim","şifrem","veritabanim"); //https yönlendir if (!(isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1) || isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')){ $redirect = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; header('HTTP/1.1 301 Moved Permanently'); header('Location: ' . $redirect); exit(); } } if (mysqli_connect_errno()) { printf("Baglanti Hatasi: %s\n", mysqli_connect_error()); exit(); } if (!mysqli_set_charset($link, "utf8")) { printf("Error loading character set utf8: %s\n", mysqli_error($link)); exit(); }