Hi now is it working, but here is the code, i am using php/oracle
In index.php that calls login.php
<?php
session_start();
header("Cache-control: private"); // IE 6 Fix.
?> //below comes the form to submit information
In login.php, that redirect to sucess or failure pages:
<?php
session_start();
header("Cache-control: private"); //IE 6 Fix
$name = $POST['user']; // coming from the initial form
$SESSION['user'] = $name;
$org = $POST['org'];
$user = $POST['user'];
$db_conn = ocilogon("xx", "xx", "xx");
$cmdstr = "SELECT o.CLIENT, o.COD_OP, o.SISTEM, o.COD_CLASS, o.NAME_OPER, f.NAME_FUNC, f.COD_TRANS, f.COD_FUNC FROM SCA_CAD_OP o ,SCA_FUNC f WHERE o.SISTEMA = 'SIST' AND o.CLIENT = '$org' AND o.COD_OPER = '$user' AND o.SISTEM = f.SISTEM AND o.COD_CLASS = f.COD_CLASS";
$parsed = ociparse($db_conn, $cmdstr);
ociexecute($parsed);
$nrows = ocifetchstatement($parsed, $results);
//while($nrows >0){extract($nrows);}
//$_SESSION[name_oper] = $NAME_OPER;
//session_register($NOME_OPER);
if($nrows>0){
header ("location: index1.php");
} else {
header ("location: index.htm");
}
OCIFreeStatement($cmdstr);
OCILogoff($db_conn);
?>
In menu.php i display the name of the user (actually his number)
<?php
session_start();
header("Cache-control: private"); //IE 6 Fix
?>
... Good morning <?PHP echo " $_SESSION[user]"; ?>
Now my goal is to extract the name of the user since i just have retrieved his number, the mname is this db field:
o.NAME_OPER .
I tried it with the extract function in login.php with these lines:
//while($nrows >0){extract($nrows);}
//$_SESSION[name_oper] = $NAME_OPER;
//session_register($NAME_OPER);
any other way to extract the name ? doing another query ? can i reuse the existing query?
Thank´s in advance