Hi,
I have a login page containing a form with two fields named user and pass.
This form is then POSTED to a validate page. Where it takes the two fields and tries to conect to my MSSSQL server and DB. This is so that the MSSQL securites can be used through my application. I am not using using a USERS table in the DB as it is more work, therefore suing the MSSQL users I can control simply the access and permissions taht each login has.
My problem is that the fields are been lost. I have checked my PHP.ini file and everything seems to be in place to allow globals to be used access but its not working. 😕
The only I seem to be able to work this is to pass the credentials through the URL after a validation so that my pages can then run the queries and gain the connection to my server and DB.
So then, my question is, is it possible to use the URLENCODE function in the header.location function?
The reason for this is so that my usernames and passwords are not humanly readable by the users. If the user can read the two credentials and know a higher up login credentials, they can simply overwrite the URL and have access to the permissions that their own login does not permit.
I have attached below my validate code.
<?
$myServer = "SERVERNAME\PHP";
$myDB = "DBNAME";
$connection = @mssql_connect($myServer, $user, $pass) ;
if (!$connection)
{
header("Location: http://IPADDRESS/invalid.php");
}
$db = @mssql_select_db($myDB, $connection) ;
if (!$db)
{
header("Location: http://IPADDRESS/invalid.php");
}
if ($connection)
{
header("Location: http://IPADDRESS/main.php?user=$user&pass=$pass");
}
?>
If you need to see more code, I shall attach it.
Thank you very much in advance 😉