dambuster
12-30-2010, 06:34 PM
I'm working very hard to create a dynamic web-site for use in the education sector using server-side php/MySQL and client-side HTML with javascript.
I have a logon page (index.php) which looks to see if the cookie 'mylogon' is set with the value 'Again'. This cookie is set when the PHP element on the server detects an invalid username/password combination. If so I have a javascript function (see below) call from the HTML <body onload="check_invalid_user()">
I know that the function Get_Cookie is working ok and that the javascript variable 'again' has the value 'Again' in it and has a length of 5. The alert function is not executed though.
function check_invalid_user()
{
again = Get_Cookie('mylogon');
// document.write(again);
// document.write(again.length);
If (again == 'Again')
{
alert("User-id and/or password incorrect -- Please re-enter");
}
}
=============
Any help would be appreciated:confused: Many thanks in advance. (Yeah you guessed it I'm new and raw to this stuff.
I have a logon page (index.php) which looks to see if the cookie 'mylogon' is set with the value 'Again'. This cookie is set when the PHP element on the server detects an invalid username/password combination. If so I have a javascript function (see below) call from the HTML <body onload="check_invalid_user()">
I know that the function Get_Cookie is working ok and that the javascript variable 'again' has the value 'Again' in it and has a length of 5. The alert function is not executed though.
function check_invalid_user()
{
again = Get_Cookie('mylogon');
// document.write(again);
// document.write(again.length);
If (again == 'Again')
{
alert("User-id and/or password incorrect -- Please re-enter");
}
}
=============
Any help would be appreciated:confused: Many thanks in advance. (Yeah you guessed it I'm new and raw to this stuff.