Hi
I wrote a very basic login script which acesses a mySQL database, like this:-
<?php
// compares values entered in login page form with mySQL database,
and then
directs either to protected page or to a failure page
$em = trim($_POST['email']);
$pw = trim($_POST['password']);
$link = mysql_connect ('server', 'account', 'password');
mysql_select_db ("database1");
// if $em and $pw match a record, then display page, else display
failure page
$query = "SELECT email, password FROM details_table WHERE (email
= '$em'
AND password = '$pw')";
$result = mysql_query ($query);
if (mysql_num_rows($result) == 1)
{
require('http://www.homesite/redirect.php');
}
else
{
echo"login failed";
}
mysql_close($link);
?>
My problem is this :-
It worked fine on my localhost test system, and fine on the first remote server/ database combination I put it on.
However, I have since tried to reuse it, calling other tables on the same database, other databases, and on other servers using other databases - and it does not work on these, although it is still runnng fine on the original configuration
Does anyone have have any ideas about why this might be, or whether there is another, more solid way of achieving what this script does ( bearing in mind I am trying to keep it as simple as possible for the moment?