Jump to content
php.lv forumi

pareiza izvade


Sephy

Recommended Posts

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 by Sephy
Link to comment
Share on other sites

<?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 by phpjanis
Link to comment
Share on other sites

×
×
  • Create New...