Location: PHPKode > projects > LAMP School > tutori/mostra11.php
<?php
	
	@include("../php-ini.php");
	// istruzioni per tornare alla pagina di login 
	session_start();	
    $tipoutente=$_SESSION["tipoutente"]; //prende la variabile presente nella sessione
	if ($tipoutente=="")
	   {
	   header("location: ../login/login.php"); 
	   die;
	   }
	
	$Connessione=mysql_connect($db_server,$db_user,$db_password);	
	if (!$Connessione)
	{
		print "Connessione non riuscita";
		exit;
	};
		

	$database=mysql_select_DB($db_nome);
	if (!$database)
	{
		print "Accesso al database fallito";
		exit;
 	};

	$query='SELECT * FROM alunni ORDER BY codalunno';
	
	if (!($result=mysql_query($query)))
		print "Query fallita";
	else
	{
		print "<HTML>";

		print "\n\n<HEADER>";
		print "\n\t<TITLE>+++|-|+++ ALUNNI +++|-|+++</TITLE>";
		print "\n</HEADER>";

		print "\n\n<BODY>";
		print "\n\t<CENTER>";
		print "\n\t<TABLE BORDER=1>";
	
		while($Data=mysql_fetch_object($result))
		{
			print "<TR><TD><A HREF='http://192.168.0.2/stage/banco_12/cerca1.php?codal=$Data->codalunno'>$Data->codalunno</A></TD>";
			print "<TD>".$Data->cognome."</TD>";
			print "<TD>".$Data->nome."</TD>";
			print "<TD>".$Data->datanasc."</TD>";
			print "<TD>".$Data->votom."</TD>";
		}	

		print "\n\t</TABLE>";
		print "\n\t</CENTER>";
		print "\n</BODY>";

		print "\n\n</HTML>";
		
	}
	mysql_close($Connessione);
?>
Return current item: LAMP School