gunmetal Posted March 29, 2010 Report Posted March 29, 2010 Kurš var pateikt, kādu php kod, kurš palīdzētu... Kods ir tikai viens. piem. man atsūta vēstu! es atpakaļ to kodu. džeks ievada to kodu un atver piem. bildi. Ja sapratat tad lūdzu palīdziet :) Quote
chizijs Posted March 29, 2010 Report Posted March 29, 2010 (edited) $kods = mysql_query("SELECT * FROM kodi WHERE kods = '".is_numeric($_POST['kods'])."'"); if(mysql_num_rows($kods) > 0){ echo"<img src='' />"; mysql_query("DELETE FROM kodi WHERE kods = '".is_numeric($_POST['kods'])."'"); }else{ echo"kods nepareizs"; } vai if($_POST['kods'] == "mans_kods"){ echo"<img src='' />"; }else{ echo"kods nepareizs"; } Edited March 29, 2010 by chizijs Quote
gunmetal Posted March 29, 2010 Author Report Posted March 29, 2010 $kods = mysql_query("SELECT * FROM kodi WHERE kods = '".is_numeric($_POST['kods'])."'"); if(mysql_num_rows($kods) > 0){ echo"<img src='' />"; mysql_query("DELETE FROM kodi WHERE kods = '".is_numeric($_POST['kods'])."'"); }else{ echo"kods nepareizs"; } vai if($_POST['kods'] == "mans_kods"){ echo"<img src='' />"; }else{ echo"kods nepareizs"; } OOO paldies bet ir iespējam ka katreiz kods ir savādāks? :) Quote
chizijs Posted March 29, 2010 Report Posted March 29, 2010 $r1 = rand(0,9); $r2 = rand(0,9); $r3 = rand(10,99); $kods = $r1.$r2.$r3; mysql_query("INSERT INTO kodi(kods) VALUES('$kods')"); Atver failu un taisi refresh ^^ Quote
rausis Posted March 29, 2010 Report Posted March 29, 2010 kapēc is_numeric? :) ...(int) vai intval() ;) Quote
xPtv45z Posted March 29, 2010 Report Posted March 29, 2010 Tāda, ka is_numeric - Returns TRUE if var is a number or a numeric string, FALSE otherwise. Quote
gunmetal Posted March 29, 2010 Author Report Posted March 29, 2010 Tāda, ka is_numeric - Returns TRUE if var is a number or a numeric string, FALSE otherwise. Nu kāpēc jājauc prāts man? :DD Es no kodēšanas neko nejēdzu :D Quote
gunmetal Posted March 29, 2010 Author Report Posted March 29, 2010 Vai gribi sākt jēgt? Nu īstenībā jā :D Quote
briedis Posted March 29, 2010 Report Posted March 29, 2010 Nu īstenībā jā :D Nu tad viens vārds - RTFM, un problēmas atrisinātas! Quote
gunmetal Posted March 29, 2010 Author Report Posted March 29, 2010 Nu tad viens vārds - RTFM, un problēmas atrisinātas! Tu domā kam man tas ko izsaka? :DDD Quote
gunmetal Posted March 29, 2010 Author Report Posted March 29, 2010 Nu tad viens vārds - RTFM, un problēmas atrisinātas! ā nu sk paldies :DDD Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.