де е грешката?

deam0n

Moderator
Екип
намирате ли тука някъде грешка?

Код:
        <form  name="addcomment" action="view.php?id=<?php echo $id; ?>" method="POST" onSubmit="document.addcomment.submit.disabled=true;">
        <input type="text" value="<?php echo $_SESSION['username']; ?>" name="user" size="40" class="login" style="width: 250px;" disabled><br>
        <input type="text" value="Необходим бюджет" name="bid" size="40" class="login" style="width: 250px;" onblur="login_inputs_change('blur', this)" onfocus="login_inputs_change('focus', this)"><br>
        <input type="text" value="Време за изпълнение" name="neededtime" size="40" class="login" style="width: 250px;" onblur="login_inputs_change('blur', this)" onfocus="login_inputs_change('focus', this)"><br>
        <textarea rows="6" cols="0" name="comment" class="login" style="font-size:1em;width: 250px;" onblur="login_inputs_change('blur', this)" onfocus="login_inputs_change('focus', this)">Коментар
        </textarea><br>
        <input type="submit" value="Изпрати" name="submit" class="login" style="width: 250px;">
        </form>
        </div>
    </td>
 </tr>
</table>

<?php
if ( $_POST['user'] == NULL and $_POST['comment'] == NULL and $_POST['bid'] == NULL and $_POST['neededtime'] == NULL )
{ echo "asd"; }

Значи ако нещо не е наред трябва да даде asd. Обаче винаги ми дава asd.
 
пробвай

<?php
if (empty( $_POST['user']))
{
echo "asd";
}
if(empty($_POST['comment']))
{
echo "asd";
}
if(empty$_POST['bid']))
{
echo "asd";
}
if(empty($_POST['neededtime'] ) )
{
echo "asd";
}
 

Back
Горе