Errore in script creando il form

kamranis1

Nuovo Utente
6 Feb 2014
7
0
0
Salve
ho creato questo form pero nel localhost e su server se provo mi da errore undefine line 47 to 57
mi potete aiutare dove ho sbagliato??

<?php

//clean white spaces and special charter from values

function cleanStr($str) {
$cStr = trim($str);
$cStr = htmlspecialchars($cStr);
$cStr = addslashes($cStr);
return $cStr;
}
//check for empty values
function emptyFields($ar) {
if(!is_array($ar)) {
print "This argument must be an array";
return false;

}
//loop through each field and check for empty
foreach($ar as $key => $value) {
if(empty($value)) {
print "<b>" . ucword($key) . "</b>
must not be empty.Please click the browser
back button and correct it.";
return false;
}
}
return true;
}
//calling function to check any empty value
if(!emptyFields($_POST)) {
exit();
}
//check required skills and age
function isEligible($skills,$age) {
$age = intval($age);
if(count($skills) ==0) {
print("You dont have any skill");
return false;
}
if($age < 23 || $age > 35 ) {
print("Your age must betwen 23 and 35");
return false;
}
return true;
}
//assigning field values to variables
$name = cleanStr($_POST['name']);
$phone = cleanStr($_POST['phone']);
$email = cleanStr($_POST['email']);
$address = cleanStr($_POST['address']);
$gender = $_POST['gender'];
$city = $_POST['city'];
$age = (int) cleanStr($_POST['age']);
$skills = $_POST['skills'];
//calling function to check
# that the candidate is eligable for appling to this job
if(!isEligibile($skills,$age)) {
exit();
}
//if everything is ok
print "<h4> Thank You". $name .
"for you intrest in this job.We Will contact you soon</h4>";
print "We recevived the following information about you. <br>";
//printing user submited information
print "Name: " . $name . "<br>";
print "Phone: " . $phone . "<br>";
print "Email: " . $email . "<br>";
print "Address: " . $address . "<br>";
print "Gender: " . $gender . "<br>";
print "City:" . $city ."<br>";
print "Age: " . $age . "<br>";
print "Your skills: " ;
foreach($skills as $value) {
print $value .",";
}

?>
 
Discussioni simili
Autore Titolo Forum Risposte Data
P [Javascript] errore su script .js.... Javascript 1
L script errore Only variables PHP 2
M Upload di files - script mi da errore PHP 1
francesco7 Errore collegamento script a Mysql Aruba PHP 0
G Errore script php PHP 0
R Errore Slideshow - "Attenzione lo script non risponde" Joomla 1
giancadeejay Script che da 2 immagini in errore PHP 10
L continuare script dopo errore PHP 4
C script non va bene, dove è l'errore? Javascript 3
S Errore funzione elimina script PHP 4
F Disperato: 'errore nello script della pagina' Javascript 0
Monital Errore 500. ma script eseguito. Come trovarlo? PHP 3
D Script banale ma non trovo l'errore PHP 5
neo996sps Errore con script per invio mail PHP 3
F errore script php PHP 30
G Errore script PHP 0
SolidSnake4 errore su script PHP 10
I Errore in script sul sito PHP 2
T Errore Shop Script Free. Aiutatemi Vi Pregoo PHP 1
T errore 80004005 - script "accesso ad aree protette" Classic ASP 7
M Script segnalazione errore PHP 2
B errore script scambio click Classic ASP 2
K Inserimento query Errore 1366 PHP 4
F errore 1062 su campo nuovo MySQL 4
N Errore interno Access MS Access 2
R mi da errore dove inizia il while PHP 1
R Recupero di permalink di un sito che è stato eliminato per errore WordPress 5
R Yoast SEO errore semafori sempre rossi SEO e Posizionamento 0
S Visualizza l'errore di creazione in MSSQL Database 4
simgia Cordova errore quando cerco di emulare o creare la app Sviluppo app per Android 2
P Errore nell'indirizzo degli elementi HTML e CSS 2
Jensen Errore di sintassi con DELETE PHP 3
H Errore su array associativo PHP 1
FDF182 ERRORE 1292 PHP 4
P errore 404 con javascript Javascript 2
felino Windows 7: errore 80072EFE su Windows Update Windows e Software 1
A errore http://datatables.net/tn/7 PHP 4
M Errore visualizzazione meta tag title e description SEO e Posizionamento 1
A Errore durante il salvataggio Photoshop 0
M Errore configurazione motion detection nvr Hikvision DS-7616 IP Cam e Videosorveglianza 0
voldemort [c] Errore di segmentazione (core dump creato) C/C++ 1
T SSD - errore sistema Hardware 2
R Navigare sito con cURL, mi restituisce errore PHP 0
L File CSV con app inventor da errore Sviluppo app per Android 2
A Errore visualizzazione selezione testo Photoshop 0
I Postman 400 Errore di richiesta non valida Programmazione 0
S Errore PHP - Notice: Undefined index ... PHP 14
U Campo vuoto data errore Fatal error: PHP 2
R Errore UPDATE tabella mysql PHP 1
R W10 Segnalazione di errore su terminale USB Windows e Software 0

Discussioni simili