Holy crap CPD, im pretty sure youre post melted my brain. Im pretty new to php (and coding outside of html and css in general) and im using the skeleton of a script i found online which would be why its out of date. Im honestly not looking for security right now, this is just a personal project im working on to get better at coding so i hope you arnt too offended by my terrible lack of regard for good coding haha. I kind of understand what youre saying at the end, what i have right now is a jquery dialog box so if the login fails ill redirect to an identical page with the dialog box autoOpen = true with the error message at the top which will be a TON easier than learning how to do an error message at the top of the form.
Also Denno020, i dont get how the login check is equal or inequal to anything. can someone explain to me what this snippet of code does?
$sql = mysql_query("SELECT * FROM users WHERE username='$username' AND password='$password' ");
$login_check = mysql_num_rows($sql);
also i am currently executing the login like this:
<script>
$(function() {
$( "#login_form" ).dialog({
autoOpen: false,
height: 300,
width: 350,
modal: true,
buttons: {
"Login": (function() { $("#login_info").submit(); }),
Cancel: function() {
$( this ).dialog( "close" );
}
},
close: function() {
allFields.val( "" ).removeClass( "ui-state-error" );
}
});
$( "#login" )
.button()
.click(function() {
$( "#login_form" ).dialog( "open" );
});
});
</script>
I have absolutly no idea if thatll work (On my html form i have an action set so im thinking that the submit function will do the same thing as html form submit would do)