Hello, I am working with php, and I dont know how to do an autentification with php. Because I have to see the database. But when I read the databases only read the first name and password, I do this, anything knows my problem:
if ($criterio=="docente"){
$query = "SELECT Nomed,password FROM Docente";
$result = mysql_query ($query)
or die ("Query failed");
# fetch rows in reverse order
for ($i = mysql_num_rows ($result) - 1; $i >=0; $i--) {
if (!mysql_data_seek ($result, $i)) {
printf ("Cannot seek to row %d\n", $i);
continue;
}
if(!($row = mysql_fetch_object ($result)))
continue;
if (($identificatore==$row->Nomed) and ($password==$row->password))
header("Location: <!-- m --><a class="postlink" href="http://jerusalem.ce.unipr.it/progetto/html/fare.html">http://jerusalem.ce.unipr.it/progetto/html/fare.html</a><!-- m -->");
this function, but if I do this more, always take only the firt name and the first password:
} else {
echo 'error';
if ($criterio=="docente"){
$query = "SELECT Nomed,password FROM Docente";
$result = mysql_query ($query)
or die ("Query failed");
# fetch rows in reverse order
for ($i = mysql_num_rows ($result) - 1; $i >=0; $i--) {
if (!mysql_data_seek ($result, $i)) {
printf ("Cannot seek to row %d\n", $i);
continue;
}
if(!($row = mysql_fetch_object ($result)))
continue;
if (($identificatore==$row->Nomed) and ($password==$row->password))
header("Location: <!-- m --><a class="postlink" href="http://jerusalem.ce.unipr.it/progetto/html/fare.html">http://jerusalem.ce.unipr.it/progetto/html/fare.html</a><!-- m -->");
this function, but if I do this more, always take only the firt name and the first password:
} else {
echo 'error';