Witam, pisze sobie taki plik, który wyświetla błędy w razie problemów na stronie, i mam taki kod:
<?php
header('Content-Type: text/html; charset=utf-8'); require_once("classes/pdo.class.php");
$db->connect();
//Getting site language
$stmt = $db->db->prepare("SELECT lang FROM xxx");
$stmt->execute();
$row = $stmt->fetch();
if(is_file("dlang/".$row['lang']."/language.php")){ //Picking languagepack name from DB
//Including Language pack
require_once("/lang/".$row['lang']."/language.php");
//Getting client IP
$ip = $_SERVER['REMOTE_ADDR'];
//Checking if IP isn't banned
$stmt = $db->db->prepare("SELECT * FROM xxx WHERE ip = '$ip'");
$stmt->execute();
$count = $stmt->rowCount();
if($count == 0){
//If ip isn't banned
//This way of banning wont work for IP's that changes.
//That's why we will make ban for account too.
}
else{
//If ip is banned
}
}
else{
echo "<style type='text/css'> body{
background:#f2f2f2;
color:#000000;
}
#error{
background:#ffffff;
width:360px;
margin:0 auto;
padding:20px;
}
#errorheader{
background:#e2e2e2;
width:320px;
height:22px;
font-weight:bold;
padding:3px 20px 3px 20px;
margin-bottom:20px;
}
</style>";
<div id='error'>
<div id='errorheader'>Language pack is not installed! <span style='font-size:9px; color:#ff0000; float:right; padding-top:6px; font-family:Tahoma;'>[Issue ID: 1000]</span></div>
There's no ".$row['lang']." language pack installed. Check if <b>".$_SERVER['DOCUMENT_ROOT']."lang/".$row['lang']."/language.php</b> exists. <br /><br /><center><u>For more help visit our forum or wiki.</u></center></div>");
}
?>
a dokladniej chodzi mi o ta czesc:
else{
echo "<style type='text/css'> body{
background:#f2f2f2;
color:#000000;
}
#error{
background:#ffffff;
width:360px;
margin:0 auto;
padding:20px;
}
#errorheader{
background:#e2e2e2;
width:320px;
height:22px;
font-weight:bold;
padding:3px 20px 3px 20px;
margin-bottom:20px;
}
</style>";
<div id='error'>
<div id='errorheader'>Language pack is not installed! <span style='font-size:9px; color:#ff0000; float:right; padding-top:6px; font-family:Tahoma;'>[Issue ID: 1000]</span></div>
There's no ".$row['lang']." language pack installed. Check if <b>".$_SERVER['DOCUMENT_ROOT']."lang/".$row['lang']."/language.php</b> exists. <br /><br /><center><u>For more help visit our forum or wiki.</u></center></div>");
}
Jak mozna umiescic ten kod CSS tak, aby ladnie wygladalo i bylo poprawnie wykonane?