scusate ragazzi ma ho un problema urgente.
questo l'errore
You don't have permission to access /mio sito/php/
Notice: Undefined variable: id in c:\programmi\easyphp1-8\www\miosito\php\scheda_immagini1.php on line 102
aggiorna_immagine1.php on this server.
prima pagina che fa l'inserimento du DB:
<?php
session_start();
if (!isset($_SESSION["ID"])){
header("Location: http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/area_riservata.php");
exit;
}
require("db.php");
$conn = mysql_connect("localhost","jsco0023","5kmojvcr") or die(mysql_error());
mysql_select_db("db",$conn) or die(mysql_error());
$sql="SELECT * FROM menu_schede";
$rawData = mysql_query($sql,$conn) or die(mysql_error());
$query ="INSERT INTO menu_schede (Modello,Anno,Km,Cambio,Alimentazione,CV,Prezzo,co lore,info) VALUES ('$_POST[modello]','$_POST[anno]','$_POST[km]','$_POST[cambio]','$_POST[alimentazione]','$_POST[cv]','$_POST[prezzo]','$_POST[colore]','$_POST[info]')";
if (mysql_query($query,$conn)){
$id = mysql_insert_id();
header("Location: http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/scheda_immagini1.php?.id=$id");
}
else{
echo "Errore durante l'inserimento";
echo mysql_error();
echo "
<a href=\"javascript:history.go(-1)>Torna alla scheda</a></p>";
}
mysql_close($conn);
?>
pagina scheda_immagini1.php in cui c'è un form per l'inserimento della prima immagine:
<?php
session_start();
if (!isset($_SESSION["ID"])){
header("Location: http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/area_riservata.php");
exit;
$id = $HTTP_GET_VARS["id"];
}
?>
<form enctype="multipart/form-data" name="modulo" action='<?php echo "aggiorna_immagine1.php?id=".$id;?>' method="post">
<tr>
<td width="6" height="10"></td>
<td width="6" height="10"></td>
<td width="132" height="10"></td>
<td width="89" height="10"></td>
<td width="175" height="10"></td>
<td width="50" height="10" valign="top"></td>
</tr>
<tr>
<td colspan="6" valign="top">Modello </td>
</tr>
<tr>
<td width="6" ></td>
<td width="6" ></td>
<td colspan="3" valign="bottom" class="testo_rosso">
<table width="397" class="bordi" cellpadding="2">
<tr>
<td>Note per l'inserimento delle immagini</td>
</tr>
<tr>
<td height="30" valign="bottom" class="testo">Inserire almeno un'immagine</td>
</tr>
<tr>
<td height="15" valign="bottom" class="testo">Inserire immagini solo in formato jpg</td>
</tr>
<tr>
<td height="15" valign="bottom" class="testo">Cominciare ad inserire le immagini dalla prima casella</td>
</tr>
<tr>
<td height="15" valign="bottom" class="testo">Inserire immagini con dimensione minima 600x450</td>
</tr>
</table> </td>
<td width="50" ></td>
</tr>
<tr>
<td width="6" height="30"></td>
<td width="6" height="30"></td>
<td height="30" colspan="4" valign="bottom" class="testo"></td>
<td width="1"></td></tr>
<tr>
<td width="6" height="30"></td>
<td width="6" height="30"></td>
<td height="30" colspan="4" valign="bottom" class="testo"></td>
</tr>
<tr>
<td width="6" height="30"></td>
<td width="6" height="30"></td>
<td height="30" colspan="4" valign="bottom" class="testo">Seleziona la 1^ foto
<input type="hidden" name="MAX_FILE_SIZE" value="102400" />
<input class="dimen1" type="file" name="allegato1" size="35" /></td>
</tr>
<tr>
<td width="6" height="67"></td>
<td width="6" height="67"></td>
<td width="132" height="67" valign="bottom" class="testo_rosso"></td>
<td width="89" height="67"></td>
<td width="175" height="67" valign="bottom" class="testo_rosso">Invia immagine
<input name="submit_upload" type="submit" value="Invia"></td>
<td width="50"></td>
</tr>
<tr>
<td width="6"></td>
<td width="6"></td>
<td width="132"></td>
<td width="89"></td>
<td width="175"></td>
<td width="50"></td>
</tr>
</form></table>
</body>
</html>
poi la pagina aggiorna_immagine1.php che fa l'upload della prima immagine e rimanda al form per l'inserimento della seconda immagine:
<?php
session_start();
if (!isset($_SESSION["ID"])){
header("Location: http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/area_riservata.php");
exit;
}
include ("upload_img_big.php");
include("upload_img.php");
require("db.php");
$id = $HTTP_GET_VARS["id"];
$img1=$upload1;
$img1_b=$upload1_b;
$conn = mysql_connect("localhost","jsco0023","5kmojvcr") or die(mysql_error());
mysql_select_db("db",$conn) or die(mysql_error());
$sql="SELECT * FROM menu_schede";
$rawData = mysql_query($sql,$conn) or die(mysql_error());
$query ="INSERT INTO menu_schede (img1,img1_b) VALUES ('$img1','$img1_b')";
if (mysql_query($query,$conn)){
header("Location: http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/scheda_immagini2.php?id=$id");
}
else{
echo "Errore durante l'inserimento";
echo mysql_error();
echo "
<a href=\"javascript:history.go(-1)>Torna alla scheda</a></p>";
}
mysql_close($conn);
?>