Hey Everyone,
I am trying to create login page where if the user doesn't enter a value into the username and password textfields a box fades in (JQuery function) telling the user to enter info. I know I can just add the required = "required"
to the input tag, but adding the fade in box will help me in adding future functionality.
What I need to do:
When the user click the "login" this happens-
<?php
session_start();
if ($_POST["uName"] != "" && $_POST["uPass"] != "") {
$_SESSION['userName'] = $_POST["uName"];
$_SESSION['password'] = $_POST["uPass"];
header("Location: pg2_profile.php");
} else {
$_SESSION['redirect'] = "true";
header("Location: ../index.php");
}
?>
If the info is good (for now the info just need to be there, later the sql database will be added) the user is redirected to the next page. If nothing is present the user is sent to the home page.
I would like that when the user is redirected to the front page a JQuerry event display a <div> telling the user to enter information into the boxes. Is this possible? Can PHP trigger a JQuery event? If not how can I implement this using JS.
Thanks