ciao a tutti, da alcuni giorni ho un problema che mi sta facendo uscire pazzo, ho una pagina
delete_articolo.php
PHP:
<?php
if(isset($_GET['id']))
{
elimina_record();
}
function elimina_record()
{
//richiamo il file di configurazione
require 'Config.php';
//richiamo il file di connessione
require 'Connect.php';
//$id=trim($_GET['id_articolo']);
//$categoria=trim($_POST['frm_modifica_categoria']);
//$id=$_GET['id'];
//preparo la query di eliminazione
$query="DELETE FROM Articoli
WHERE id_articolo='".$_GET['id']."'";
//invio query
if(!mysql_query($query))
{
die("errore nella query;".mysql_error());
}
//$messaggio=urlencode("Articolo eliminato");
//header('location:'.'../app_eye_articolo.php'.'?msg='.$messaggio);
header('location:'.'../app_eye_articolo.php');
exit;
//chiudo la connessione
mysql_close();
}
?>
Poi ho la pagina chiamante
eye.articoli.php
PHP:
<?php
//richiamo il file di configurazione
require 'Config.php';
//richiamo il file di connessione
require 'Connect.php';
//creo la SELECT
$query="SELECT * FROM Articoli WHERE id_categ='".$_GET['id']."'";
//eseguo la query
$risultato=mysql_query($query);
if(!$risultato)
{
die("errore nella query;".mysql_error());
}
//chiudo la connessione
mysql_close();
?>
<html>
<head>
<meta http-equiv="Content-Language" content="it">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Nuova pagina 1</title>
</head>
<body>
<div align="left">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="882" height="33" id="AutoNumber1">
<tr>
<td width="19" height="33" rowspan="11">
</td>
<td width="866" height="20" valign="top" colspan="2">
<img border="0" src="immages/active_linea.gif" width="857" height="11">
</td>
<td width="24" height="33" rowspan="11" valign="top">
</td>
</tr>
<tr>
<td width="866" height="1" valign="top" colspan="2">
</td>
</tr>
<tr>
<td width="866" height="1" valign="top" colspan="2">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%" id="AutoNumber2" height="46">
<tr>
<td width="23%" height="21" valign="top" style="border-left-style: solid; border-left-width: 1; border-right-style: none; border-right-width: medium; border-top-style: solid; border-top-width: 1; border-bottom-style: solid; border-bottom-width: 1">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber3" height="54">
<tr>
<td width="6%" height="28" align="center" bgcolor="#FF9933"><b>
<font face="Bookman Old Style" size="1" color="#FFFFFF">Elimina</font></b>
</td>
<td width="6%" height="28" align="center" bgcolor="#FF9933"><b>
<font face="Bookman Old Style" size="1" color="#FFFFFF">Modifica</font></b>
</td>
<td width="14%" height="28" align="center" bgcolor="#FF9933"><p><b>
<font face="Bookman Old Style" size="1" color="#FFFFFF">Codice Articolo</font></b>
</td>
<td width="30%" height="28" align="center" bgcolor="#FF9933"><p align="left"><b>
<font face="Bookman Old Style" size="1" color="#FFFFFF">Descrizione Prodotto</font></b>
</td>
<td width="12%" height="28" align="center" bgcolor="#FF9933"><b>
<font face="Bookman Old Style" size="1" color="#FFFFFF">Categoria</font></b>
</td>
<td width="8%" height="28" align="center" bgcolor="#FF9933"><b>
<font face="Bookman Old Style" size="1" color="#FFFFFF">Prezzo</font></b>
</td>
<td width="6%" height="28" align="center" bgcolor="#FF9933"><b>
<font face="Bookman Old Style" size="1" color="#FFFFFF">Disp</font></b>
</td>
<td width="6%" height="28" align="center" bgcolor="#FF9933"><b>
<font face="Bookman Old Style" size="1" color="#FFFFFF">Off</font></b>
</td>
<td width="6%" height="28" align="center" bgcolor="#FF9933"><b>
<font face="Bookman Old Style" size="1" color="#FFFFFF">Nov</font></b>
</td>
<td width="6%" height="28" align="center" bgcolor="#FF9933"><b>
<font face="Bookman Old Style" size="1" color="#FFFFFF">Rich</font></b>
</td>
</tr>
<?php
while($riga=mysql_fetch_array($risultato,MYSQL_ASSOC))
{
print"<tr>";
print"<td width='5%' height='22' align='center'>
<font face='Palatino Linotype' size='1'>
<a href='Articolo/delete_articolo.php?id=$riga[id_articolo]'><img border='0' src='immages/cestino.gif' width='55' height='37'></a></font></td>";
print"<td width='7%' height='22' align='center'>
<font face='Palatino Linotype' size='1'>
<a href='app_frm_modifica_articolo.php?id=$riga[id_articolo]'><img border='0' src='immages/modifica.gif' width='55' height='37'></a></font></td>";
print"<td width='14%' height='22' align='center'>
<font face='Bookman Old Style' size='1'>$riga[codice]</font></td>";
print"<td width='30%' height='22' align='center'>
<p align='left'><font face='Bookman Old Style' size='1'>$riga[descrizione]</font></td>";
print"<td width='12%' height='22' align='center'>
<font face='Bookman Old Style' size='1'>$riga[id_categ]</font></td>";
print"<td width='8%' height='22' align='center'>
<font face='Bookman Old Style' size='1'>$riga[prezzo]</font></td>";
print"<td width='6%' height='22' align='center'>
<font face='Bookman Old Style' size='1'>$riga[disponibile]</font></td>";
print"<td width='6%' height='22' align='center'>
<font face='Bookman Old Style' size='1'>$riga[offerta]</font></td>";
print"<td width='4%' height='22' align='center'>
<font face='Bookman Old Style' size='1'>$riga[novita]</font></td>";
print"<td width='7%' height='22' align='center'>
<font face='Bookman Old Style' size='1'>$riga[richiesto]</font></td>";
print"</tr>";
}
?>
</table>
</td>
</tr>
</tr>
</table>
</td>
</tr>
<tr>
<td width="866" height="8" valign="bottom" colspan="2" align="center">
</td>
</tr>
<tr>
<td width="866" height="1" valign="top" colspan="2">
</td>
</tr>
<tr>
<td width="866" height="12" valign="top" colspan="2">
<img border="0" src="immages/active_linea.gif" width="857" height="11">
</td>
</tr>
<tr>
<td width="866" height="1" valign="bottom" colspan="2" align="center">
<font face="Palatino Linotype" size="2">Pagina</font>
</td>
</tr>
</table>
</div>
</body>
</html>
come si dice a caserta, "gir e vot, gir e vot, m trov semp o stess post
Traduzione
gira gira mi trovo sempre qua :beer:
mi da un errore
Codice:
Notice: Undefined index: id in c:\programmi\easyphp1-8\www\studio\sito_gennaro\gestione\Articolo\eye_articoli.php on line 9
la riga num 9 è questa
PHP:
$query="SELECT * FROM Articoli WHERE id_categ='".$_GET['id']."'";
potreste aiutarmi ad uscirne fuori
anche provando voi lo script
fornendomi una spiegazione di quest'errore, in modo da non capitarci +?
grazie da minatore