Header ('Content-type: text/html; charset=utf-8'); include("./../config/connect_a.inc.php"); $skin=$_REQUEST['skin']; $todo=$_REQUEST['todo']; $den=Date("d"); $mes=Date("m"); $rok=Date("Y"); if($todo == "dalsi") { $vysledek_test_v = @mysql_query("SELECT click FROM vtipy_ext_click WHERE den = $den AND mes = $mes AND rok = $rok"); if(mysql_num_rows($vysledek_test_v)>0){ @mysql_query("UPDATE vtipy_ext_click SET click = click + 1 WHERE den = $den AND mes = $mes AND rok = $rok"); } else{ @mysql_query("INSERT INTO vtipy_ext_click(click, den, mes, rok) VALUES( 1, $den, $mes, $rok)"); } Header("Location: http://astroseznamka.cz/index.php?co=legracky"); exit; } $vysledek_v = @MySQL_Query("SELECT id FROM vtipy WHERE kostka = 1"); while ($zaznam_v = MySQL_Fetch_Array($vysledek_v)){ $idv[] = $zaznam_v["id"]; $v = $zaznam_v["id"]; } SRand((double)MicroTime()*1e6); $limit = Count($idv); $rand = rand(0,$limit); $nahodna = $idv[$rand]; if(!$nahodna){$nahodna = $v;} $vysledek_vz = @MySQL_Query("SELECT * FROM vtipy WHERE id = $nahodna"); $zaznam_vz = MySQL_Fetch_Array($vysledek_vz); if(!$skin){$skin = 1;} echo"
Vtip na dnešek: |
".$zaznam_vz["vtip"]." |
Další vtip |