<html> <head> <meta http-equiv="Content-Language" content="pl"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2"> <link rel="stylesheet" href="style.css" type="text/css"> <title>Pozdrowienia</title> </head> <body bgcolor="#9FB8E4"> <center> <? include('konsola/serwer.php'); //tutaj sie ustawia w sec po ilu moze ktos pozdrowic $czaskoniec = "30"; $ip=$HTTP_SERVER_VARS['REMOTE_ADDR']; $tresc = $HTTP_POST_VARS[tresc]; $odkogo = $HTTP_POST_VARS[odkogo]; $akcja = $HTTP_POST_VARS[akcja]; if ($mysql_link>0) $query = "SELECT * from pozdrowienia where ip='$ip' ORDER BY `data` DESC LIMIT 1"; { $datas = $row[data]; $trescs = $row[tresc]; } } if($data-$datas > $czaskoniec) { if($akcja == "tak") { if ($mysql_link>0) $query = "INSERT INTO pozdrowienia (ip, data, tresc, kto, pokaz) values ('$ip', '$data', '$tresc', '$odkogo' , 'nie')"; { print("<font face=Verdana size=1 color=FF0000>Pozdrowienia zostały dodane. Następne możesz wysłać za <b>$czaskoniec</b> sekund. Dzięki!</font> "); } } } } else { echo"<font face=Verdana size=1 color=FF0000>Spiesz się powoli... Jeszcze nie twoja pora!</b>. .</font> "; } ?> </center> </body> </html>
Ten wysyła do bazy mysql. A tutaj odczytuję:
<? include "funkcje.inc"; ?> <html> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-2"> <meta http-equiv="Content-Language" content="pl"> <link rel="stylesheet" href="style.css" type="text/css"> <title>..:: Konsola dla Prezentera - ArtRadio.pl ::..</title> </head> <body bgcolor="#9FB8E4"> <center> <? if(!auth()) { if($_SESSION['PROBA'] == True) { echo "Zły login lub hasło! Spróbuj jeszcze raz! \n"; } include "login.forma"; } else { include('serwer.php'); $usun = $HTTP_POST_VARS[usun]; $id = $HTTP_POST_VARS[id]; if($usun == "tak") { if ($mysql_link>0) $query2 ="update pozdrowienia set pokaz='tak' where id='$id'"; } } if($usun == "wszystkie") { if ($mysql_link>0) $query2 ="delete from pozdrowienia"; } } if ($mysql_link>0) $query = "SELECT * FROM pozdrowienia where pokaz='nie' ORDER BY `data` DESC"; if ($ile > "0") { echo"Ilosć pozdrowień: $ile <hr size = 1>"; { $odkogo = $row[kto]; $tresc = $row[tresc]; $id = $row[id]; $ip = $row[ip]; } } else { } } } ?> </center> <center> </center> </body> </html>
I chciałbym aby obok ip była data w formacie: HH:MM DD:MM:RRRR (godzina:minuty , dzień:miesiąc:rok) MOgłby ktoś to dla mnie przerobić? Będe wdzięczny