It's telling you the $_POST values you're referencing do not exist. Are you submitting a form to this page? If so, make sure you check your form field names. If not - this script needs a form submitting to it.
Either the POST doesn't contain the variables in question, or you aren't performing a POST in the first place.
These lines cause the "undefined index" warnings.
$username = $_POST['user_name'];
$password = $_POST['password'];
$type = $_POST['user_type'];
When you submit a form to this script, $_POST
is an array containing all the form elements. In your case the user_name
, password
and user_type
form elements did not exist, or you did not submit a form. Thus, the array elements do not exist. When you try to read from a nonexistant array element, you get the "Undefined Index" notice.
The other warning is caused by this line:
$count = mysql_numrows($info);
You're passing $info
, an array, to mysql_numrows
. You should be passing it a result resource from a mysql_query. You should be passing $data
to mysql_numrows
.
try:
$count = mysql_numrows($data);
it says you're passing the mysql_numrows an array when it expects a resource.