hello everybody i have a trouble with {PHP:add_revendeur.php}
in this page http://www.logimmo.com/corporate/index. ... 71,0,0,1,0
you can found the add_revendeur.php here :
http://www.logimmo.com/corporate/add_revendeur.php
As you can see code run here but not include the cms...
I post a part of the code here... And sure need some help ;o)
<form action="<?php echo $_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING'] ?>" method="post" enctype="multipart/form-data">
<table width="100%" cellpadding="2" cellspacing="0">
<? if ($error)
{
?>
<tr>
<td><br>
<blockquote><? echo $error; ?></blockquote>
</td>
</tr>
<?
}
?>
<tr>
<td>Denomination </td>
<td><input type="text" size="40" name="denomination" value="<? echo stripslashes($denomination); ?>"></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>Adresse</td>
<td><input type="text" size="40" name="adresse" value="<? echo stripslashes($adresse); ?>"></td>
</tr><tr>
<td>Code postal</td>
<td><input type="text" size="8" name="codepostal" value="<? echo stripslashes($codepostal); ?>">
Ville
<input type="text" size="23" name="ville" value="<? echo stripslashes($ville); ?>"></td>
</tr>
<tr>
<td>Pays</td>
<td>
<select name="pays">
<option value="F"<? if ($pays=="F") echo " selected"; ?>>France</option>
<option value="L"<? if ($pays=="L") echo " selected"; ?>>Luxembourg</option>
<option value="D"<? if ($pays=="D") echo " selected"; ?>>Allemagne</option>
<option value="B"<? if ($pays=="B") echo " selected"; ?>>Belgique</option>
<option value="E"<? if ($pays=="E") echo " selected"; ?>>Espagne</option>
<option value="P"<? if ($pays=="P") echo " selected"; ?>>Portugal</option>
<option value="I"<? if ($pays=="I") echo " selected"; ?>>Italie</option>
</select>
</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>Contact</td>
<td><input type="text" size="40" name="contact" value="<? echo stripslashes($contact); ?>"></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>Email</td>
<td><input type="text" size="40" name="email" value="<? echo stripslashes($email); ?>"></td>
</tr><tr><td>Site web</td>
<td><input type="text" size="40" name="url" value="<? echo stripslashes($url); ?>"></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>Telephone</td>
<td><input type="text" size="20" name="tel" value="<? echo stripslashes($tel); ?>" maxlength="20"></td>
</tr>
<tr>
<td>Fax</td>
<td><input type="text" size="20" name="fax" value="<? echo stripslashes($fax); ?>" maxlength="20"></td>
</tr>
<tr>
<td> </td>
</tr>
<td>Login</td>
<td><input type="text" name="log" value="<? echo stripslashes($log); ?>"></td>
</tr>
<tr>
<td>Mot de passe</td>
<td><input type="text" name="pass" value="<? echo stripslashes($pass); ?>"></td>
<td colspan="2"> </td>
</tr>
<tr>
<td></td><td>
<input type="hidden" name="type" value="REV">
<input type="hidden" name="menu" value="<?php echo $_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING'] ?>">
<input type="submit" name="modvalid" value="Devenir revendeur">
</td>
<td> </td>
</tr>
</table>
<?
print("</form>");
?>
external php include problems.. :o(
"Resultant" Source (based on DOM):Plain old "view source" in IE 6:Instead of:
Code: Select all
<INPUT type='hidden' name='type' />
<INPUT type='hidden' name='menu' />
<INPUT type='submit' name='modvalid' />
Code: Select all
<input type="hidden" name="type" value="REV">
<input type="hidden" name="menu" value="/corporate/index.php?id=0,71,0,0,1,0">
<input type="submit" name="modvalid" value="Devenir revendeur">
Code: Select all
<input type="hidden" name="type" value="REV">
<input type="hidden" name="menu" value="/corporate/add_revendeur.php?">
<input type="submit" name="modvalid" value="Devenir revendeur">
.../...
I try all but doesnt work...
<input type="hidden" name="type" value="REV">
<input type="hidden" name="menu" value="/corporate/add_revendeur.php?">
<input type="submit" name="modvalid" value="Devenir revendeur">
I cant setup $modvalid
here the code (run on add_revendeur.php) !!
if ($modvalid)
{
if (!$insertion) $insertion = "N"; else $insertion = "O";
$url = ereg_replace("http://","",$url);
$url = ereg_replace(" ","",$url);
if (!$denomination) $error = "Veuillez précisez le nom...<br>\n";
if (!$contact) $error .= "Veuillez précisez le contact...<br>\n";
if (!$tel) $error .= "Veuillez précisez le numéro de téléphone principal...<br>\n";
if (!$log) $error .= "Veuillez choisir un login d'identification...<br>\n";
if (!$pass)
{
$error .= "Veuillez choisir un mot de passe d'identification...<br>\n";
}
elseif (strlen(stripslashes($pass)) < 5)
{
$error .= "Le mot de passe doit être de 5 caractères minimum...<br>\n";
}
else
{
$mdp2verif = md5(stripslashes($pass));
$verif = mysql_result(mysql_query("select count(*) from vendeurs where pass = '$mdp2verif'"),0,0);
if ($verif != 0)
{
$error .= "Le mot de passe est dejà utilisé, veuillez en choisir un autre...<br>\n";
}
}
if (!$error)
{
$datimport = date("Y-m-d");
$req = "INSERT INTO vendeurs (
client_id, log, pass, type, insertion, denomination, tel, tel2,
fax, gsm, adresse, codepostal, ville, pays, email, url, contact, dat_inscrip, humhum)
VALUES
('', '$log', '$mdp2verif', '$type', '$insertion', '$denomination', '$tel', '',
'$fax', '', '$adresse', '$codepostal', '$ville', '$pays', '$email', '$url', '$contact', '$datimport', '$pass')";
mysql_query($req);
$error = "Merci <b>'$denomination'</b> votre demande est prise en compte\n";
unset($denomination);
unset($adresse);
unset($ville);
unset($pays);
unset($codepostal);
unset($contact);
unset($email);
unset($url);
unset($tel);
unset($tel2);
unset($fax);
unset($gsm);
unset($log);
unset($pass);
unset($type);
}
}
<input type="hidden" name="type" value="REV">
<input type="hidden" name="menu" value="/corporate/add_revendeur.php?">
<input type="submit" name="modvalid" value="Devenir revendeur">
I cant setup $modvalid
here the code (run on add_revendeur.php) !!
if ($modvalid)
{
if (!$insertion) $insertion = "N"; else $insertion = "O";
$url = ereg_replace("http://","",$url);
$url = ereg_replace(" ","",$url);
if (!$denomination) $error = "Veuillez précisez le nom...<br>\n";
if (!$contact) $error .= "Veuillez précisez le contact...<br>\n";
if (!$tel) $error .= "Veuillez précisez le numéro de téléphone principal...<br>\n";
if (!$log) $error .= "Veuillez choisir un login d'identification...<br>\n";
if (!$pass)
{
$error .= "Veuillez choisir un mot de passe d'identification...<br>\n";
}
elseif (strlen(stripslashes($pass)) < 5)
{
$error .= "Le mot de passe doit être de 5 caractères minimum...<br>\n";
}
else
{
$mdp2verif = md5(stripslashes($pass));
$verif = mysql_result(mysql_query("select count(*) from vendeurs where pass = '$mdp2verif'"),0,0);
if ($verif != 0)
{
$error .= "Le mot de passe est dejà utilisé, veuillez en choisir un autre...<br>\n";
}
}
if (!$error)
{
$datimport = date("Y-m-d");
$req = "INSERT INTO vendeurs (
client_id, log, pass, type, insertion, denomination, tel, tel2,
fax, gsm, adresse, codepostal, ville, pays, email, url, contact, dat_inscrip, humhum)
VALUES
('', '$log', '$mdp2verif', '$type', '$insertion', '$denomination', '$tel', '',
'$fax', '', '$adresse', '$codepostal', '$ville', '$pays', '$email', '$url', '$contact', '$datimport', '$pass')";
mysql_query($req);
$error = "Merci <b>'$denomination'</b> votre demande est prise en compte\n";
unset($denomination);
unset($adresse);
unset($ville);
unset($pays);
unset($codepostal);
unset($contact);
unset($email);
unset($url);
unset($tel);
unset($tel2);
unset($fax);
unset($gsm);
unset($log);
unset($pass);
unset($type);
}
}
- Oliver Georgi
- Site Admin
- Posts: 9904
- Joined: Fri 3. Oct 2003, 22:22
- Contact:
The problem is that you have no access to the $var from your form because of the INCLUDE PHP function. It is included in a function in frontend rendering. So you have to use $_POST['my_formvar'] when you want to get posted values. Never use these kind of "register_globals" get value functionality. This should help you.
Regards
Oliver
Regards
Oliver