Jump to content
php.lv forumi

Recommended Posts

Posted

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 :)

Posted (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 by chizijs
Posted

$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? :)

Posted

$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 ^^

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...