Thx for everyone's help. I just realised tat the codeis illogical.
This is the correct code.
This is part of the code from the dreamweaver LogInUser server behaviour. Added that if login failed error variable will be set.
if (isset($_POST['uid'])) {
$MM_redirectLoginFailed = "login.php?error=1";
That's to be written @ the body part. Where ever you want the message to be displayed. Also, I have removed the hidden field as it's not needed at all.
<?php if(isset($_GET['error'])){ ?>
<p align="center" class="warning" >User name or password is invalid. Please login again. </p>
<?php } ?>
This is all corrected by my lecturer. She did mention y cannot use POST to catch the error. Because dreamweaver redirect login failed using
header("Location: ". $MM_redirectLoginFailed );
Said something about header only passed the URL. Not the values to the other page. That's what i faintly rmb. Sorry if explanation is wrong.
Hope this will help other newbies who's stuck @ dd login page with dreamweaver's login user server behaviour. with a little php coding.