Page de formulaire

romcha
Invité n'ayant pas de compte PHPfrance

19 déc. 2010, 17:48

Bjre,

J'ai un pb incompréhensible :

J'ai un site : http://www.clubcaninrochois dont le formulaire de la page d'identification de l'administrateur fonctionne parfaitement en ligne. Or ce même fichier en local m'envoi l'erreur suivante : Fatal error: Call to undefined method tNG_fields::tNG_fields() in G:\wamp\www\site_canin\includes\tng\tNG_custom.class.php on line 19.
Si cela fonctionne dans un cas, pourquoi pas dans l'autre qui est strictement identique.

et voici le script du fichier concerné : (j'ai numéroté les 19 premières lignes puisque l'erreur serait à la 19 ???

1<?php require_once('../Connections/canin.php'); ?>
2<?php
3// Load the common classes
4require_once('../includes/common/KT_common.php');
5
6// Load the tNG classes
7require_once('../includes/tng/tNG.inc.php');
8
9// Make a transaction dispatcher instance
10$tNGs = new tNG_dispatcher("../");
11
12// Make unified connection variable
13$conn_canin = new KT_connection($canin, $database_canin);
14
15// Start trigger
16$formValidation = new tNG_FormValidation();
17$formValidation->addField("kt_login_user", true, "text", "", "", "", "");
18$formValidation->addField("kt_login_password", true, "text", "", "", "", "");
19$tNGs->prepareValidation($formValidation);
20// End trigger
21
22if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}

mysql_select_db($database_canin, $canin);
$query_rsmembres = "SELECT * FROM membres";
$rsmembres = mysql_query($query_rsmembres, $canin) or die(mysql_error());
$row_rsmembres = mysql_fetch_assoc($rsmembres);
$totalRows_rsmembres = mysql_num_rows($rsmembres);

// Make a login transaction instance
$loginTransaction = new tNG_login($conn_canin);
$tNGs->addTransaction($loginTransaction);
// Register triggers
$loginTransaction->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "kt_login1");
$loginTransaction->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation);
$loginTransaction->registerTrigger("END", "Trigger_Default_Redirect", 99, "{kt_login_redirect}");
// Add columns
$loginTransaction->addColumn("kt_login_user", "STRING_TYPE", "POST", "kt_login_user");
$loginTransaction->addColumn("kt_login_password", "STRING_TYPE", "POST", "kt_login_password");
$loginTransaction->addColumn("kt_login_rememberme", "CHECKBOX_1_0_TYPE", "POST", "kt_login_rememberme", "0");
// End of login transaction instance

// Execute all the registered transactions
$tNGs->executeTransactions();

// Get the transaction recordset
$rscustom = $tNGs->getRecordset("custom");
$row_rscustom = mysql_fetch_assoc($rscustom);
$totalRows_rscustom = mysql_num_rows($rscustom);?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>index</title>
<link href="../css/frmstyle.css" rel="stylesheet" type="text/css" />
<link href="../includes/skins/mxkollection3.css" rel="stylesheet" type="text/css" media="all" />
<script src="../includes/common/js/base.js" type="text/javascript"></script>
<script src="../includes/common/js/utility.js" type="text/javascript"></script>
<script src="../includes/skins/style.js" type="text/javascript"></script>
<?php echo $tNGs->displayValidationRules();?><style type="text/css">
<!--
body {
background-image: url(/img/Fond%20chien%20berger%20allemand.gif);
}
.Style1 {color: #FFFFFF}
-->
</style></head>

<body class="tfvHighlight">
<div align="center">Indentification <br />
<?php
echo $tNGs->getLoginMsg();
?>
<?php
echo $tNGs->getErrorMsg();
?>
</div>
<form method="post" id="form1" class="KT_tngformerror" action="<?php echo KT_escapeAttribute(KT_getFullUri()); ?>">
<div align="center">
<table cellpadding="2" cellspacing="0" class="KT_tngtable">
<tr>
<td class="KT_th"><label for="kt_login_user">
Email :
</label> </td>
<td>
<input type="text" name="kt_login_user" id="kt_login_user" value="<?php echo KT_escapeAttribute($row_rscustom['kt_login_user']); ?>" size="32" /> <?php echo $tNGs->displayFieldHint("kt_login_user");?> <?php echo $tNGs->displayFieldError("custom", "kt_login_user"); ?> </td>
</tr>
<tr>
<td class="KT_th"><label for="kt_login_password">
Mot de passe :
</label> </td>
<td>

<div align="center">
<input type="password" name="kt_login_password" id="kt_login_password" value="" size="32" />
<?php echo $tNGs->displayFieldHint("kt_login_password");?> <?php echo $tNGs->displayFieldError("custom", "kt_login_password"); ?> </div></td>
</tr>
<tr>
<td class="KT_th"><label for="kt_login_rememberme"> M&eacute;moriser :
</label></td>
<td><input <?php if (!(strcmp(KT_escapeAttribute($row_rscustom['kt_login_rememberme']),"1"))) {echo "checked";} ?> type="checkbox" name="kt_login_rememberme" id="kt_login_rememberme" value="1" />
<?php echo $tNGs->displayFieldError("custom", "kt_login_rememberme"); ?> </td>
</tr>
<tr class="KT_buttons">
<td colspan="2"><input type="submit" name="kt_login1" id="kt_login1" value="Envoyer" /> </td>
</tr>
</table>
</div>
<div align="center"></div>
<div align="center"></div>
<div align="center"> <a href="/index.php">Accueil</a> | <a href="/admsite/forgot_password.php" class="Style1"> Mot passe oublié?</a> </div>
</form>

<?php
mysql_free_result($rsmembres);
?>
</body>
</html>



Un grand, gros, merci à qui pourra m'éclairer.

Sincèrement vôtre

charom

ViPHP
ViPHP | 1996 Messages

19 déc. 2010, 19:33

Est ce que $formValidation est bien un objet ?
fais un var_dump pour vérifier.
It is nice to be important but it is more important to be nice
http://www.aureuswebfactory.fr