Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function AuthenticateForm()
- {
- session_name();
- session_start();
- WriteHeaders("Authenticate");
- if ($_POST)
- {
- $error = LoginCheck($_POST);
- if (trim($error)=="")
- {
- $_SESSION['merchant_id'] = Login($_POST);
- if(isset($_SESSION['merchant_id']));
- {
- echo "<form action = \"?\" method=\"post\">\n";
- echo "Login Sucessful<br /><br />";
- DisplayButton("submit","f_Main","Continue to Main Menu");
- //test lines
- echo "session is registered: ".session_is_registered("merchant_id");
- echo "Merchant ID is : ".$_SESSION['merchant_id'];
- echo "</form>";
- }
- }
- else
- {
- echo "Error : ".$error;
- }
- }
- WriteFooters();
- }
- function Login ($forms)
- {
- $username = $forms['f_Username'];
- $password = $forms['f_Password'];
- /* do your sql query again, but now returning the id of member */
- OpenConnectionandDatabase($username,$password);
- $query = "SELECT * FROM Authenticate WHERE 'username' = \"".$username."\" AND 'password' = \"".$password."\"";
- echo $query;
- $result = mysql_query($query);
- echo $result;
- $row = mysql_fetch_array($result);
- echo "row value".$row['Merchant_ID'];
- $merchantid = $row['Merchant_ID'];
- echo $merchantid;
- CloseConnection();
- return $merchantid;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement