Hello Folks,

I need help. This is my Code:

<?php require_once('Connections/InfoSystem.php'); ?>
<?php
// *** Start the session
session_start();
// *** Validate request to log in to this site.
$FF_LoginAction = $HTTP_SERVER_VARS['PHP_SELF'];
if (isset($HTTP_SERVER_VARS['QUERY_STRING']) && $HTTP_SERVER_VARS['QUERY_STRING']!="") $FF_LoginAction .= "?".$HTTP_SERVER_VARS['QUERY_STRING'];
if (isset($HTTP_POST_VARS['username'])) {
$FF_valUsername=$HTTP_POST_VARS['username'];
$FF_valPassword=$HTTP_POST_VARS['password'];
$FF_fldUserAuthorization="";
$FF_redirectLoginSuccess="info.php";
$FF_redirectLoginFailed="index_fault.php";
$FF_rsUser_Source="SELECT user_name, password ";
if ($FF_fldUserAuthorization != "") $FF_rsUser_Source .= "," . $FF_fldUserAuthorization;
$FF_rsUser_Source .= " FROM passwd WHERE user_name='" . $FF_valUsername . "' AND password='" . $FF_valPassword . "'";
mysql_select_db($database_InfoSystem, $InfoSystem);
$FF_rsUser=mysql_query($FF_rsUser_Source, $InfoSystem) or die(mysql_error());
$row_FF_rsUser = mysql_fetch_assoc($FF_rsUser);
if(mysql_num_rows($FF_rsUser) > 0) {
// username and password match - this is a valid user
$MM_Username=$FF_valUsername;
session_register("MM_Username");
if ($FF_fldUserAuthorization != "") {
$MM_UserAuthorization=$row_FF_rsUser[$FF_fldUserAuthorization];
} else {
$MM_UserAuthorization="";
}
session_register("MM_UserAuthorization");
if (isset($accessdenied) && false) {
$FF_redirectLoginSuccess = $accessdenied;
}
mysql_free_result($FF_rsUser);
session_register("FF_login_failed");
$FF_login_failed = false;
header ("Location: $FF_redirectLoginSuccess");
exit;
}
mysql_free_result($FF_rsUser);
session_register("FF_login_failed");
$FF_login_failed = true;
header ("Location: $FF_redirectLoginFailed");
exit;
}
?>
<?php echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml";>
<head>
<title>HotelSurf Informations System</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
<!--
@import url("hotelsurf.css");
-->
</style>
</head>
<body bgcolor="#D2edf6">



<p align="center" class="tabellenueberschrift-01"><font size="5"><strong>HotelSurf
Gast Informations Seiten</strong></font></p>
<p align="center" class="tabellenueberschrift-01"><strong><font size="5">LOGIN
</font></strong></p>


<form action="<?php echo $FF_LoginAction?>" method="POST" name="form1" id="form1">
<p>&nbsp;</p>
<table width="28%" border="1" align="center" class="tabellen-inhalt">
<tr>
<td>Username:</td>
<td> <input name="username" type="text" id="username" /></td>
</tr>
<tr>
<td>Passwort:</td>
<td> <input name="password" type="text" id="password" /></td>
</tr>
<tr align="left">
<td colspan="2">
<div align="center">
<input type="submit" name="Submit" value="Submit" />
</div></td>
</tr>
</table>
<p>&nbsp; </p>
</form>
<p align="center" class="tabellenueberschrift-01">&nbsp; </p>
</body>
</html>



The function is pretty simple, In this Page is a form where the User can enter his username and password, when he clicks on submit the script checks the input with the entries in the database. If its ok the script sends him to the page info.php if its not ok he comes to the page index_fault.php.
This is all functioning but my problem is I have to paste at least the username to the page info.php.
If I set the action to info.php and use $HTTP_GET_VARS its functioning but I cant use that action I need <?php echo $FF_LoginAction?> to verify the user.
As far as I know I cant use two actions.
Has anybody a idea how to do that, I'm sitting on this page now for 30 hours without brake but I just dont get it.


Thanks

Dalibor Malek



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to