ray_loubayi
Messages postés8Date d'inscriptionmercredi 4 août 2010StatutMembreDernière intervention26 mars 2012
-
24 mars 2012 à 13:48
Utilisateur anonyme -
24 mars 2012 à 17:18
Bonjour,
j'aimerais bien que vous m'aidé, voici mon pb, jai fais une page php ou jai inclu du java script mais bisaremnt rien ne marche je vais posté les codes pour voir si klk1 pt m'aporté de l'aide
php+html:
<?php $title = $_SESSION['title'];
if ($_POST['submit'] == "submit") //add student
$openfile = fopen($filename, "a") or die ("could not open the $filename file");
//Write to file now
$written = fwrite($openfile, $records) or die ("could not write to the $filenale file");
//Close the file
fclose($openfile) or die ("could not close the $openfile file");
$db = mysql_connect($host,$user,$password) or die("Unable to connect to database");
@mysql_select_db("$dbname",$db) or die("Unable to select
database $dbname");
if (reason != "") {
alert("Please feel all the form:\n" + reason);
return false;
}
return true;
}
function validatelfname(fld) {
var error = "";
var stripped = fld.value.replace(/[\(\)\.\-\ ]/g, '');
if (fld.value == "") {
fld.style.background = 'Yellow';
error = "enter your First name .\n";
} else if (isNaN(parseInt(stripped))) {
error = "illegals caracters.\n";
} else if (stripped.length >20{
fld.style.background = 'Yellow';
error = "frist name cannot have more than 20caracters.\n";
}
else {
fld.style.background = 'white';
}
return error;
}
function validatemname(fld) {
var error = "";
var stripped = fld.value.replace(/[\(\)\.\-\ ]/g, '');
if (fld.value == "") {
fld.style.background = 'Yellow';
error = "Enter the middle name please.\n";
} else if (isNaN(parseInt(stripped))) {
error = "illegal caracters.\n";
else {
fld.style.background = 'white';
}
return error;
}
function validatellname(fld) {
var error = "";
var stripped = fld.value.replace(/[\(\)\.\-\ ]/g, '');
if (fld.value == "") {
fld.style.background = 'Yellow';
error = "Enter your last name please.\n";
} else if (isNaN(parseInt(stripped))) {
error = "illegal caracters.\n";
else {
fld.style.background = 'white';
}
return error;
}
function validatesid(fld) {
var error = "";
var stripped = fld.value.replace(/[\(\)\.\-\ ]/g, '');
if (fld.value == "") {
fld.style.background = 'Yellow';
error = "Enter the student ID please.\n";
} else if (isNaN(parseInt(stripped))) {
error = "the ID have illegal caraters.\n";
function validatelfname(fld) {
var error = "";
var stripped = fld.value.replace(/[\(\)\.\-\ ]/g, '');
if (fld.value == "") {
fld.style.background = 'Yellow';
error = "enter your First name .\n";
} else if (isNaN(parseInt(stripped))) {
error = "illegals caracters.\n";
} else if (stripped.length >20{
fld.style.background = 'Yellow';
error = "frist name cannot have more than 20caracters.\n";
}
else {
fld.style.background = 'white';
}
return error;
}
function validatelsmname(fld) {
var error = "";
var stripped = fld.value.replace(/[\(\)\.\-\ ]/g, '');
if (fld.value == "") {
fld.style.background = 'Yellow';
error = "enter your First middle name.\n";
} else if (isNaN(parseInt(stripped))) {
error = "illegals caracters.\n";
} else if (stripped.length >20{
fld.style.background = 'Yellow';
error = "frist name cannot have more than 20caracters.\n";
}
else {
fld.style.background = 'white';
}
return error;
}
function validateslname(fld) {
var error = "";
var stripped = fld.value.replace(/[\(\)\.\-\ ]/g, '');
if (fld.value == "") {
fld.style.background = 'Yellow';
error = "Enter your last name please.\n";
} else if (isNaN(parseInt(stripped))) {
error = "illegal caracters.\n";
else {
fld.style.background = 'white';
}
return error;
}
function validatelmcode(fld) {
var error = "";
var stripped = fld.value.replace(/[\(\)\.\-\ ]/g, '');
if (fld.value == "") {
fld.style.background = 'Yellow';
error = "enter the modul code.\n";
} else if (isNaN(parseInt(stripped))) {
error = "illegals caracters.\n";
} else if (stripped.length >6 {
fld.style.background = 'Yellow';
error = "three letters and three digits please.\n";
}
else {
fld.style.background = 'white';
}
return error;
}
function validategrade(fld) {
var error = "";
var stripped = fld.value.replace(/[\(\)\.\-\ ]/g, '');
if (fld.value == "") {
fld.style.background = 'Yellow';
error = "enter the modul code.\n";
} else if (isNaN(parseInt(stripped))) {
error = "illegals caracters.\n";
Bonjour, ton code est trop long et personne à envi de l'étudier.
Essai de "découper" ton code pour savoir d'ou viens le problème et reviens avec le bout de code qui pose problème.