droctoganapus86
New Member
- Messages
- 49
- Reaction score
- 0
- Points
- 0
hello,
I have a contact/email form made powered with php, and i'd like to have some extra things added. But i dont know anything about php, so who would like to help me? :biggrin:
the extra's are email attachment and maybe checkboxes so you can select one or more. also, if you can find something to prevent "flooding" (pressing the button 100 times) that would be nice.
I have this script :
I have a contact/email form made powered with php, and i'd like to have some extra things added. But i dont know anything about php, so who would like to help me? :biggrin:
the extra's are email attachment and maybe checkboxes so you can select one or more. also, if you can find something to prevent "flooding" (pressing the button 100 times) that would be nice.
I have this script :
Code:
<?php
session_start();
$mail=' '; //je email
include('validEmail.php');
if($_POST['send']){
if(!validEmail($_POST['mail'])){
$_SESSION['message']='Please fill in a correct Email-adress.';
}
elseif(trim($_POST['name'])==""){
$_SESSION['message']='Please fill in your name.';
}
elseif(trim($_POST['message'])==""){
$_SESSION['message']='Please type your message.';
}
else{
$_SESSION['message']='Thanks, your message has been send.';
}
mail($mail,'Bericht van: '.trim($_POST['name']),$_POST['message'],'From: '.trim($_POST['name']).' <'.$_POST['mail'].'>');
}
?>
Code:
<form action="#" method="post">
<label for="name">Name :</label><br />
<input class="info" type="text" value="<?php echo($_POST['name'])?$_POST['name']:'';?>" name="name" id="name" />
<label for="mail">E-mail :</label><br />
<input class="info" type="text" value="<?php echo($_POST['mail'])?$_POST['mail']:'';?>" name="mail" id="mail" />
<label for="message">Message :</label><br />
<textarea class="info" name="message" id="message" cols="" rows="5" ><?php echo($_POST['message'])?$_POST['message']:'';?></textarea>
<div><input class="send" type="submit" value="Send" name="send" /></div>
</form>
Last edited: