Reputation: 41
How can I pass two session variables to loan_officer1.php
in below code
function redirect_to($location = NULL){ if($location != NULL){ header("Location:{$location}"); exit; } } if(mysql_query($query,$connection)){ //sucess redirect_to('loan_officer1.php'); }else{ confirm_query($query); }
Upvotes: 1
Views: 2596
Reputation:
When you use sessions in php then you don't need to pass session variables explicitly.
You can declare session variables suppose on your index page as
<?php
session_start();
$_Session['loan_officer_name'] = 'ABC DEF';
$_Session['loan_officer_post'] = 'Officer';
?>
and then just call your session variables wherever on any page you need to call like
<?php
session_start();
echo $_Session['loan_officer_name'];
?>
Remember to call session_start(); on page you want to access session variables.
Upvotes: 1
Reputation: 5094
You do not need to pass the..just use this in your loan_officer1.php
$_SESSION['name']
and it will give you the value stored in it
Upvotes: 0