Sephy Posted June 5, 2008 Report Posted June 5, 2008 (edited) tatad skripta dala kas parbauda vai man kads no laukiem nav azipildits if(!$_POST['username'] | !$_POST['pass']) { die("<p>Kads no laukiem nav aizpildits!</p>");} man nepatik ka vinhs izmet to pazinojumu pa visu ekranu... es gribetu lai vinhs vienkarshi mana <div id="logform"></div> uzraxta augshaa ka lauki nav aizpilditi un viss. kaa tod abut gatavu?! Edited June 5, 2008 by Sephy
Paulinjsh Posted June 5, 2008 Report Posted June 5, 2008 if(empty($_POST['username']) || empty($_POST['pass'])) { echo '<p>Kads no laukiem nav aizpildits!</p>'; }
andrisp Posted June 5, 2008 Report Posted June 5, 2008 Uzkodējot, protams. Kas nav skaidrs ? PS. Un | vietā izmanto ||. Palasi manuāli par atšķirību.
Sephy Posted June 5, 2008 Author Report Posted June 5, 2008 'Paulinjsh' tavs variant s isti neder jo ja nav ievadits akds no laukiem man pec tam vel parbaudis vai username ir vai nav ja es ielikshu vienkarshi echo...
superKrona Posted June 5, 2008 Report Posted June 5, 2008 Kāpēc neder, username pārbaudi takš veiksi ar nākošo IFu!
777 Posted June 5, 2008 Report Posted June 5, 2008 $error = ""; if(empty($_POST['kads_lauks']) $error .= "Tu aizmirsi aizpildit lauku"; if($error == "") { // izpildam } else { echo $error; }
Paulinjsh Posted June 5, 2008 Report Posted June 5, 2008 (edited) kas tur nepareizi? kā prasīji tā atbildēju. nekur tavā jautājumā nekas par to, kas tālāk notiek nav minēts. Edited June 5, 2008 by Paulinjsh
werd Posted June 5, 2008 Report Posted June 5, 2008 (edited) <?php if(!$_POST['username']) { $msg = "Neesi ievadijis lietotajvards"; $msg_type= 'style="color:#E10000;font-size:12px;font-family:Arial;font-weight:bold;"'; if(!$_POST['pass']){ $msg = "Neesi ievadijis paroli"; $msg_type= 'style="color:#E10000;font-size:12px;font-family:Arial;font-weight:bold;"'; } else{ //tagad viss ir aizpildits $msg = "Viss okk"; $msg_type= 'style="color:#000000;font-size:12px;font-family:Arial;font-weight:bold;"'; } } ?> <div <?=$msg_type?>><?=$msg?></div> Edited:Un protams to visu izpildi, tad, kad ir nospiesta submit poga - if(isset($_POST['submit'])) Edited June 5, 2008 by phpjanis
Recommended Posts