
Originariamente inviata da
Alhazred
Sì, ma "non funziona" non vuol dire niente, che succede? Ti da errore? Ti da un risultato che non è quello che vuoi? Che altro?
Scrivi anche il codice che hai attualmente, compresa la funzione verifica_dati_immessi()
Fornisce sempre lo stesso errore:
Notice: Undefined index: upload4 in C:\...\index.php on line 1589
ecco la funzione...
Codice PHP:
function verifica_dati_immessi($post_regione, $post_text, $files3, $files4, $post_categories, $regioni) {
if ($post_regione == '' or $post_regione == '') {
$error = "xxx.";
include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php';
exit();
} else {
switch ($post_regione) {
case $regioni[0]:
//$regioni[0]=Home
if ($post_text == '') {
$error = "xxx.";
include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php';
exit();
}
break;
case $regioni[1]:
//$regioni[1]=Gallery
if ($files3 == '' or $files4 == '' or $post_categories == '') {
$error = "xxx.";
include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php';
exit();
}
break;
case $regioni[2]:
//$regioni[2]=News
if ($post_text == '') {
$error = "xxx.";
include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php';
exit();
}
break;
case $regioni[3]:
//$regioni[3]=Risultati
if ($post_text == '' or $post_categories == '') {
$error = "xxx.";
include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php';
exit();
}
break;
default:
$error = "xxx.";
include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php';
exit();
}
}
}
ho risolto con un if + un isset, purtroppo penso che in php non sia possibile fornire una variabile non inizializzata come argomento di una funzione... credo che sia questo il motivo... concordate?