Codice PHP:
<?php
session_start();
require_once ("class_connect_db.php");
// Controllo accesso
if (!isset($_SESSION['login']) && $_SESSION['password'] ) {
header('location: index.php');
} else {
echo "Benvenuto ".$_SESSION['login'];
}
$query="SELECT record FROM tabella WHERE Creatore='".$_SESSION['login']."' AND Nome='".$Nome."'";
$result = mysql_query($query);
$num_rows = mysql_result($result);
if (mysql_num_rows($result)>0) {
/*A QUESTO PUNTO L'UTENTE è LOGGATO E VALIDO NE ANALIZZO LA MESTIERE*/
switch($num_rows['record']) { case 1:
header ("Location: [url]http://www.sito.it/mestiere/barista.html[/url]");
break;
case 2:
header ("Location: [url]http://www.sito.it/mestiere/macellaio.html[/url]");
break;
default:
case 3:
header ("Location: [url]http://www.sito.it/mestiere/calciatore.html[/url]");
break;
}
} ?>
Mi pare di aver visto alcuni errori e ho modificato...
controlla intanto se entra nel case..
EDIT
I LINK nell header li mette l'insermento del post sul forum
quindi presumo sia giusto di suo