Probleme scrip de contact

Résolu/Fermé
Gallice Messages postés 58 Date d'inscription mercredi 4 février 2009 Statut Membre Dernière intervention 30 août 2010 - 18 nov. 2009 à 19:59
Gallice Messages postés 58 Date d'inscription mercredi 4 février 2009 Statut Membre Dernière intervention 30 août 2010 - 19 nov. 2009 à 17:57
Bonjour,

Voila j'ai ce script de contacte mai je ne vois pas ou mettre mon adresse mail pour recevoir les messages des mes membres directement dans ma boite mail.Pouvez vous m'aider svp.
Merci d'avance

Voici le script


<?
session_start();
include "config.php";
global $c,$loggedin;
include "data.php";
global $config;
include "funciones.php";
?>

<html>
<head>
<title><?=$config["title"];?></title>
<link rel="stylesheet" type="text/css" href="css.css">
</head>
<body leftmargin="0" topmargin="0">
<script language=JavaScript>
<!--
function ismaxlength(obj){
var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : ""
if (obj.getAttribute && obj.value.length>mlength)
obj.value=obj.value.substring(0,mlength)
}
//-->
</script><br />
<table width="900" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td class="maintop">


<table width="100%" border="0" cellpadding="0" cellspacing="0">

<tr>
<td width="50%" height="80" class="maintopright">
<div class="maintopright">  <a href="index.php"><img src=images/top.png border="0" align="middle"></a></div>
</td>
<td width="49%" class="maintopright"><div align="right">
<?php
if($loggedin == 1)
{

if ($r["account"]=="premium")
{
$upgrade = "(Upgraded Member)";
} else {
$upgrade = "(Standard Member <a href=upgrade.php>Upgrade</a>)";
}
print "Logged in as {$r['username']} {$upgrade} [<a href=index.php?action=logout>Logout</a>]";
} else {
print "Guest [<a href=login.php>Login</a> | <a href=register.php>Register</a>]";
}
?></div></td><td width="1%" class="maintopright"><td>
</tr>

</table> </td>
</tr>
<tr>
<td align="left" valign="top" class="main"><div>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="900" align="center" valign="top" class="maincenter"><div style="margin-top:2; margin-bottom:2;">
<table width="100%" border="0" cellspacing="0" cellpadding="6">
<tr>
<td class="topper"><div align="center">
<?=$config["menu"];?>
</div></td>

</tr>
<tr>
<td colspan="5" style="FONT-SIZE: 5px; BACKGROUND-COLOR: #FFFFFF; border-top:solid 1px #999999;"> </td>
</tr>
</table> <table width="95%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td class="midinfo">
<div class="heading">Contact Us</div><br />

<?

if ($_POST) {



$name=securedata($_POST["name"]);
$email=securedata($_POST["email"]);
$topic=securedata($_POST["topic"]);
$subject=securedata($_POST["subject"]);
$comments=securedata($_POST["comments"]);

if($_POST['code']!=$_SESSION['string']){
$error = 1;
$errormsg .= "<b>Error - </b>The captcha code was entered incorrectly!<br />";
}
if ($name==""){
$error = 1;
$errormsg .= "<b>Error - </b>You must supply your name!<br />";
}
if ($email==""){
$error = 1;
$errormsg .= "<b>Error - </b>You must supply your email!<br />";
}
if ($topic==""){
$error = 1;
$errormsg .= "<b>Error - </b>You must pick a topic!<br />";
}
if ($subject==""){
$error = 1;
$errormsg .= "<b>Error - </b>You must pick a subject!<br />";
}
if ($comments==""){
$error = 1;
$errormsg .= "<b>Error - </b>You must enter comments/description!<br />";
}
$gp = mysql_query("SELECT COUNT(*) AS cnt FROM tb_contact WHERE ip='{$_SERVER['REMOTE_ADDR']}'");
$gp = mysql_fetch_array($gp);
$gp = $gp['cnt'];
if($gp > 1)
{
$error = 1;
$errormsg .= "<b>Error - </b>You can only send one support ticket in at a time!<br />";
}
$errormsg .= "<br /><br />";
if($error == 1)
{
print $errormsg;
} else {

$laip = getRealIP();

$query = "INSERT INTO tb_contact (name, email, topic, subject, comments, ip) VALUES('$name','$email','$topic','$subject','$comments','$laip')";
mysql_query($query) or die(mysql_error());

echo "Your message has been sent correctly.<br />
You cannot send any more support tickets until your current ticket has been responded.";
showFooter();
exit();
}
}
?>

Use the form below to contact <?=$config["site_name"];?> support. Replies may take up to 48 hours or more depending on our work load.
<br><br>
<form method="post" action="contact.php" name="form">
<font color="9c1515">*</font> Your Name:<br />
<input type="text" name="name" size="25" maxlength="100" class="form" autocomplete="off"><br />
<font color="9c1515">*</font> Your E-mail:<br />
<input type="text" name="email" size="25" maxlength="100" class="form" autocomplete="off"><br />
<font color="9c1515">*</font> Topic:<br/>
<select name="topic" class="form" autocomplete="off">
<option value="">Select Topic</option>
<option value="General Non-Member Inquiry">General Non-Member Inquiry</option>
<option value="Member Comment/Question/Feedback">Member Comment/Question/Feedback</option>
<option value="Advertising Inquiry">Advertising Inquiry</option>
<option value="Media/Press/Blog">Media/Press/Blog</option>
<option value="Spam Issue">Spam Issue</option>
<option value="Other">Other</option>
</select><br />
<font color="9c1515">*</font> Subject:<br />
<input type="text" class="form" autocomplete="off" name="subject" size="25" maxlength="100"><br />

<font color="9c1515">*</font> Comments:<br/>
<textarea name="comments" class="form" autocomplete="off" cols="45" rows="4" maxlength="100" onKeyUp="ismaxlength(this);"></textarea><br />

<font color="9c1515">*</font> Security Code:<br/>
<img src="image.php" onclick="this.src='image.php?newtime=' + (new Date()).getTime();">(Click to reload)<br />
<input type="text" name="code" class="form" autocomplete="off" size="5"><br />

<input type="submit" value="Submit">

</form>

<?php
showFooter();
?>

3 réponses

Gallice Messages postés 58 Date d'inscription mercredi 4 février 2009 Statut Membre Dernière intervention 30 août 2010
19 nov. 2009 à 13:57
up
0
Bonjour,
Déjà je te conseille de séparer logique/présentation dans ton code, par ce que là c'est la mouise à lire.
Look du côté MVC --> https://fr.wikipedia.org/wiki/Mod%C3%A8le-Vue-Contr%C3%B4leur
ou simplement avec un petit moteur de template SMARTY --> www.smarty.net
Certes un peu rebutant au début, c'est pas du temps perdu et tes devs seront propres !
Pour ce qui est de la gestion d'envoi de mail --> https://stephaneey.developpez.com/tutoriel/php/phpmailer/
Simple, efficace
@+
0
Gallice Messages postés 58 Date d'inscription mercredi 4 février 2009 Statut Membre Dernière intervention 30 août 2010
19 nov. 2009 à 17:57
Merci Julio
0