Bonjour tous le monde, j'ai créer un site (www.ratemysite.fr) et depuis que j'ai touché le fichier templates d'une page mon formulaire ne marche plus ... J'ai essayé chercher l'erreur mais je ne vois vraiment pas d'où elle vient.
Je vous explique, lorsque l'on ajouter un site à ma base de donnée, tout a l'air de bien fonctionner sauf que le formulaire ne fait pas son travail et donc aucune information est ajouté à ma base de donnée. Pourtant il n'y a aucun message d'erreur. Je ne comprend plus rien :(
Voici la page de traitement<?
require_once("conn.php");
require_once("access.php");
if(isset($_POST[s1]))
{
$NewDomain = $_POST[domain].".".$_POST[ext];
$NewDomain = strtolower($NewDomain);
$q1 = "insert into domain_domains set
memberid = '$_SESSION[MemberID]',
categoryid = '$_POST[CategoryID]',
domainname = '$NewDomain',
DomainDesc = '$_POST[DomainDescription]',
offers = '$_POST[offers]' ";
mysql_query($q1) or die(mysql_error());
header("location:ManageDomains.php");
exit();
}
require_once("templates/header.php");
//get the categories
$q2 = "select * from domain_categories order by categoryname";
$r2 = mysql_query($q2) or die(mysql_error());
$SelectCategory = "<select name=\"CategoryID\" class=\"InputField\">\n\t";
$SelectCategory .= "<option value=\"\"></option>\n\t";
while($a2 = mysql_fetch_array($r2))
{
$SelectCategory .= "<option value=\"$a2[categoryid]\">$a2[categoryname]</option>\n\t";
}
$SelectCategory .= "</select>";
$DomainExtentions = "<select name=\"ext\" class=\"InputField\">\n";
$qe = "select * from domain_ext order by ExtText";
$re = mysql_query($qe) or die(mysql_error());
while($ae = mysql_fetch_array($re))
{
$DomainExtentions .= "<option value=\"$ae[ExtText]\">$ae[ExtText]</option>\n\t";
}
$DomainExtentions .= "<option selected=\"selected\">.fr</option></select>";
require_once("templates/PostDomainTemplate.php");
require_once("templates/footer.php");
?>
Et la page de template<script>
function CheckDomain()
{
if(document.f4.domain.value=="")
{
alert('Enter your domain name, please!');
document.f4.domain.focus();
return false;
}
if(document.f4.ext.value=="")
{
alert('Enter your domain name extention, please!');
document.f4.ext.focus();
return false;
}
if(document.f4.CategoryID.value=="")
{
alert('Select a category for your domain name, please!');
document.f4.CategoryID.focus();
return false;
}
if(document.f4.DomainDescription.value=="")
{
alert('Describe your domain in a few words, please!');
document.f4.DomainDescription.focus();
return false;
}
}
function montre1()
{
if(document.getElementById)
{
document.getElementById("calque1").style.visibility = 'visible';
}
else if(document.all)
{
document.all["calque1"].style.visibility = 'visible';
}
}
function montre2()
{
if(document.getElementById)
{
document.getElementById("calque2").style.visibility = 'visible';
}
else if(document.all)
{
document.all["calque2"].style.visibility = 'visible';
}
}
function cache1()
{
if(document.getElementById)
{
document.getElementById("calque1").style.visibility = 'hidden';
}
else if(document.all)
{
document.all["calque1"].style.visibility = 'hidden';
}
}
function cache2()
{
if(document.getElementById)
{
document.getElementById("calque2").style.visibility = 'hidden';
}
else if(document.all)
{
document.all["calque2"].style.visibility = 'hidden';
}
}
</script>
<style type="text/css">
<!--
.Style2 {
color: #009900;
font-weight: bold;
}
.Style3 {color: #FF0000}
-->
</style>
<div id="Page_top">
<p>
<strong>Vendre un site internet</strong><br/>
Vous êtes sur le point de vendre un site internet. Veillez à ce que tous les champs soient bien remplis pour une annonce parfaite. <br />
Dans la description de votre site, éssayez de noter le plus de détails possible.<br/>
</p>
</div>
<form method="post" name="f4" onsubmit="return CheckDomain();" action="PostDomain.php">
<table width="100%" align=center>
<tr>
<td align=right class=TableData><div align="left"><img src="images/adresse.png" width="101" height="25" /></div></td>
<td><input name="domain" type="text" class="InputField" value="www." size="35"><b>.</b><?=$DomainExtentions?></td>
</tr>
<tr>
<td align=right class=TableData><div align="left"><img src="images/categorie.png" width="101" height="25" /></div></td>
<td><?=$SelectCategory?></td>
</tr>
<tr>
<td align=right class=TableData valign=top><div align="left"><img src="images/description.png" width="101" height="25" /></div></td>
<td><textarea name="DomainDescription" class="InputField" rows="4" cols="42"></textarea></td>
</tr>
<tr>
<td align=center class=TableData valign="top"> </td>
<td class=TableData>
<input type="radio" name="offers" value="y" class="InputField" checked>Oui, reçevoir les offres par e-mail
<input type="radio" name="offers" value="n" class="InputField">Non, ne pas reçevoir les offres par e-mail</td>
</tr>
<tr>
<td> </td>
<td><input type="image" name="s1" src="images/terminer.png"></td>
</tr>
</table>
</form>