1
Joomla! 1.6/1.7/2.5 / pagina php
« il: 21 Gen 2013, 02:00:47 »
Ho una semplice pagina php (vecchio sito php-nuke) che devo utilizzare e non riesco a farla funzionare
cosa sbaglio?
Codice: [Seleziona]
<?php
include("modules/Albo/include/config.php"); // dati di connessione db
include ("modules/Albo/include/header.inc.php");
mysql_connect($dbhost, $dbuname,$dbpass) or die ("impossibile connettersi");
//selezione del DB
mysql_select_db($dbname) or dir ("impossibile selezionare il db");
?>
<form action ="" method="post">
<center>Inserisci tipo di Corso: <input type=text name="a"></br></center>
<center>Inserisci data del corso: <input type=text name="b"></br></br></center>
<center><input type="submit"></center>
</br></br></br>
<?php
$sqlquery = "SELECT * FROM $table WHERE Corso = '$a' and Data_Corso = '$b'";
//$sqlquery = "SELECT * FROM $table order by Cognome ";// estrae tutto l'elenco in ordine alfabetico
$result = mysql_query($sqlquery);
$number = mysql_numrows($result);
$i = 0;
if ($number < 1) {
print "<center><p>La ricerca non ha prodotto nessun risultato</p></center>";
}
else {
print
"<table width=\"100%\" cellspacing=\"0\" border=\"0\" bgcolor=\"#FFFF00\">
<tr valign=\"top\">
<td width=\"25\"><font color=\"#000080\" size=\"2\"><b>N</b></font></td>
<td width=\"160\"><font color=\"#000080\" size=\"2\"><b>Cognome e Nome</b></font></td>
<td width=\"130\"><font color=\"#000080\" size=\"2\"><b>Qualifica</b></font></td>
<td width=\"130\"><font color=\"#000080\" size=\"2\"><b>Postazione</b></font></td>
<td width=\"60\"><font color=\"#000080\" size=\"2\"><b>Corso</b></font></td>
<td width=\"60\"><font color=\"#000080\" size=\"2\"><b>Data</b></font></td>
<td width=\"250\"><font color=\"#000080\" size=\"2\"><b>Email</b></font></td>
<td width=\"80\"><font color=\"#000080\" size=\"2\"><b>Cell</b></font></td>
</tr></table></br>";
while ($number > $i) {
$theCognome = mysql_result($result,$i,"Cognome");
$theNome = mysql_result($result,$i,"Nome");
$theQualifica = mysql_result($result,$i,"Qualifica");
$thePostazione = mysql_result($result,$i,"Postazione");
$theCorso = mysql_result($result,$i,"Corso");
$theData_Corso = mysql_result($result,$i,"Data_Corso");
$theEmail = mysql_result($result,$i,"Email");
$theCell = mysql_result($result,$i,"Cell");
$i1= $i+1;
print
"<table width=\"100%\" cellspacing=\"0\" border=\"0\">
<tr valign=\"top\">
<td width=\"25\">$i1)</td>
<td width=\"160\">$theCognome $theNome</td>
<td width=\"130\">$theQualifica</td>
<td width=\"130\">$thePostazione</td>
<td width=\"60\">$theCorso</font></td>
<td width=\"60\">$theData_Corso</td>
<td width=\"250\">$theEmail</td>
<td width=\"80\">$theCell</td>
</tr></table>";
$i++;
}
}
?>
questa se usata sotto nuke funziona perfettamente se la sposto nella radice del joomla mi restituisce errore.. non si connette al db



cosa sbaglio?