buongiorno ho un problema con questo codice:
Codice PHP:
<?php
include('dati.php');
session_start();
$link=mysql_connect("$databaseHostName","$databaseUserName","$databaseUserPassword")
or die ("Non riesco a connettermi a $databaseHostName");
mysql_select_db ($databaseName, $link)
or die ("Non riesco a selezionare il db $databaseName<br>");
?>
<form action='' method='post'>
<tr>
<td>Tipo di richiesta</td>
<td>:</td>
<td><input type='radio' name='btn_submit' value='1' onclick='this.form.submit();'>Intervento Tecnico</input></td>
<td><input type='radio' name='btn_submit' value='2' onclick='this.form.submit();'>Materiale di consumo</input></td>
<td><input type='radio' name='btn_submit' value='3' onclick='this.form.submit();'>HW/SW aggiuntivo </input></td>
<?php
$btn_submit = $_POST['btn_submit']; //linea 78
$_SESSION['btn_submit'] = $btn_submit;
if ($btn_submit=='1')
{
echo "<textarea name='comments' cols='105' rows='9'>richiesta intervento tecnico...</textarea><br>";
}
if ($btn_submit=='2')
{
$RMC = "SELECT marca,matricola FROM materiali";
mysql_query($RMC) or die (mysql_error());
echo "<table width='600px' align='center' border='1' bgcolor='#CCFFFF'>
<tr>
<th>Marca</th>
<th>Matricola</th>
</tr>";
while($row = mysql_fetch_array($RMC)) //linea 94
{
echo "<tr>";
echo "<td>" . $row['marca'] . "</td>";
echo "<td>" . $row['matricola'] . "</td>";
}
}
if ($btn_submit=='3')
{
echo "<textarea name='comments' cols='105' rows='9'>richiesta HW/SW aggiuntivo...</textarea><br>";
}
?>
</tr>
di seguito un tail del /var/log/httpd/error.log
codice:
[Thu Jun 05 11:30:29 2014] [error] [client 127.0.0.1] PHP Notice: Undefined index: btn_submit in /var/www/html/personale.php on line 78
[Thu Jun 05 11:30:33 2014] [error] [client 127.0.0.1] PHP Warning: mysql_fetch_array() expects parameter 1 to be resource, string given in /var/www/html/personale.php on line 94, referer: http://127.0.0.1/personale.php
Infine i Dati relativi al sistema:
S.O. Centos 6.5
php-5.3.3-27.el6_5.x86_64
httpd-2.2.15-29.el6.centos.x86_64
mysql-5.1.73-3.el6_5.x86_64
spero possiate essermi d'aiuto, grazie.