aboutsummaryrefslogtreecommitdiff
path: root/Html/contact.php
blob: 58f7def7b3efdc2d545cbe9ad70ba8c5b1ebfcac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<?php
require_once 'includes/config.php';

//Titre de la page
$pagetitle = 'Contactez-nous !';

//Stats : bbclone
define("_BBC_PAGE_NAME", $pagetitle);
define("_BBCLONE_DIR", "bbclone/");
define("COUNTER", _BBCLONE_DIR."mark_page.php");
if (is_readable(COUNTER)) include_once(COUNTER);

include_once 'includes/header.php';
?>

<body>

<div id="container">

   	<?php
	   include_once 'includes/header-logo.php';
	   include_once 'includes/nav.php';
	?>

    	<div id="body">
	<div id="content">

	<?php
	include_once 'includes/ariane.php';
	?>


<?php
// Affichage : message envoyé !
if(isset($_GET['action'])){
	echo '<div class="alert-msg rnd8 success">Votre message a bien été envoyé !<br />Nous y répondrons dès que possible !</div>';
}
?>

<?php
if(isset($_GET['wrong_code'])) {
	echo '<br /><div class="alert-msg rnd8 error">Mauvais code anti-spam !</div>';
}
?>


<?php
//if form has been submitted process it
if(isset($_POST['submit'])) {

	$name = html($_REQUEST["name"]);
        $subject = html($_REQUEST["subject"]);
        $message = nl2br(bbcode($_REQUEST["message"]));
        $from = html($_REQUEST["from"]);
        $verif_box = $_REQUEST["verif_box"];


 	if($name ==''){
                $error[] = 'Veuillez entrer un pseudo.';
        }

        if($from ==''){
                $error[] = 'Veuillez entrer une adresse e-mail.';
        }

        if($subject ==''){
                $error[] = 'Veuillez préciser un sujet.';
        }

        if($message ==''){
                $error[] = 'Votre message est vide ?!?';
        }


	if(md5($verif_box).'a4xn' == $_COOKIE['tntcon']) {
		if(!isset($error)) {
			$message = "Nom: ".$name."\n".$message;
        		$message = "De: ".$from."\n".$message;
        		mail(SITEMAIL, 'Message depuis '.SITENAMELONG.' : '.$subject, $_SERVER['REMOTE_ADDR']."\n\n".$message, "From: $from");
        		header("Location: contact.php?action=ok");
        		setcookie('tntcon','');
		}
	}
	
	else {
    		$error[] = 'Mauvais code anti-spam!';
	}
}

	if(isset($error)) {
		foreach($error as $error){
        		echo '<div class="alert-msg rnd8 error">'.$error.'</div>';
        	}
	}
?>

<h3>Nous contacter :</h3>
<p>Merci d'utiliser le formulaire ci-dessous pour nous contacter :</p>

<form action="" method="post">

Votre nom :<br />
<?php
	$nom = isset($_POST['name']) ? $_POST['name'] : '';
?>
<input name="name" type="text" value="<?php echo html($nom); ?>"/>
<br />
<br />

Votre e-mail :<br />
<?php
        $de = isset($_POST['from']) ? $_POST['from'] : '';
?>
<input name="from" type="text" value="<?php echo html($de); ?>"/>
<br />
<br />

Sujet :<br />
<?php
        $sujet = isset($_POST['subject']) ? $_POST['subject'] : '';
?>
<input name="subject" type="text" value="<?php echo html($sujet); ?>"/>
<br />
<br />

Anti-spam : veuillez recopier le code ci-dessous<br />
<input name="verif_box" type="text"/>
	<img src="verificationimage.php?<?php echo rand(0,9999);?>" alt="verification" width="50" height="24" align="absbottom" />
	<br />
	<br />

Message :<br />

<textarea name="message" style="height:300px;width:915px;"></textarea>

<p><input name="submit" class="searchsubmit formbutton" type="submit" value="Envoyer le message"/> <input type="reset" value="Annuler" /></p>
</form>

	</div>

	<?php require('sidebar.php'); ?>
        
    	<div class="clear"></div>
    </div>
</div>

<div id="footer">
	<?php require('includes/footer.php'); ?>
</div>

</body>
</html>