What I need to do.... In php-part of my login.php I check the user password and login this way:
<?php
// some code
session_start();
$query = "SELECT * FROM CRM.Users WHERE Login = '$l_username' AND Password = '$l_password'";
$result = mysql_query($query) or die ( "Error : ".mysql_error() );
while($row = mysql_fetch_assoc($result)){
...
if(mysql_num_rows($result) < 1){
// echo The password or login is wrong
</php>
In My HTML i have:
<div id="dialog" title="Basic dialog">
<p>The password or login is wrong</p>
</div>
And in my JS part I have:
function myfunction()
{
$( function() {
$( "#dialog" ).dialog();
} );
}
But when I bind MyFunction()
with some test submit button (by onClick
event) I see the DIV part in my page like common html text. But I dont want to see it while the condition wont true. So, My questions:
- How I can realize the password/login check, throwing dialog box and when User click OK, i want to pull out user to index.php page
- How I can hide the DIV for Dialog while condition is false