function checkusername() {
	var username=$('#newuser input[name=user]').val();
	var password=$('#newuser input[name=password]').val();
		if(username=="" || password=="") {
			toastr.error('You must enter a username and a password');
				if(username=="") {
					newuser.user.focus();
				} else if(password=="") {
					newuser.password.focus();
				}
		} else if(alphanumeric(username)==false || alphanumeric(password)==false) {
			if(alphanumeric(username)==false) {
				toastr.error('Username contains invalid characters');
				newuser.user.focus();
			} else if(alphanumeric(password)==false) {
				toastr.error('Password contains invalid characters');
				newuser.password.focus();
			}
		} else {
			jQuery.ajax({
				type: 'post',
				url: 'functions/ajaxhelper.php',
				data: 'function=1&username='+username,
				cache: false,
				success: function(response) {
					if(response==1) {
						toastr.error('Username already exists');
						newuser.user.focus();
					} else {
						$('#newuser').trigger('submit', true);
					}
				}
			});
		}
}
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.