allora, nel file funzioni.php
Codice PHP:
if (!function_exists("connetti")) {
function connetti($usr, $psw) {
global $ex_path;
$ret_com = shell_exec($ex_path."getinfo -l ".$usr." ".$psw);
echo "ret_com=" .$ret_com;
$ret_exp = explode(";", $ret_com);
$_SESSION['nom'] = $ret_exp[1];
$_SESSION['cog'] = $ret_exp[2];
return $ret_exp[0];
}
Dato che non so come è strutturato il tuo sito, potresti non vedere niente. In questo caso prova a mettere la variabile in un file:
Codice PHP:
if (!function_exists("connetti")) {
function connetti($usr, $psw) {
global $ex_path;
$ret_com = shell_exec($ex_path."getinfo -l ".$usr." ".$psw);
$myFile = "file_con_path_relativo_ad_una_directory_con_permesso_di_scrittura";
$fh = fopen($myFile, 'w') or die("can't open file");
fwrite($fh, "ret_com=" .$ret_com;);
fclose($fh);
$ret_exp = explode(";", $ret_com);
$_SESSION['nom'] = $ret_exp[1];
$_SESSION['cog'] = $ret_exp[2];
return $ret_exp[0];
Vedi che output ottieni