PHP expert |
|
ik kom er echt niet uit, die mailfunctie moet mij niet ofzo want hij doet niet wat ik wil
dus mijn vraag kunnen jullie hier even een mail functie in bouwen
hiervoor mot hij het sture
echo 'The email has been sent!';
setcookie('Request',1,time()+($spam*60));
echo 'The email has been sent!';
iid er zitten delen van het contactformulier van tuinstoel in
hier de phpcode
owjah, of het zo kan :
name: hier de naam
mail: hier de email
hexcolors: hexcolor1, hexcolor2 (als die er is) etc (met , ertusse please )
codering: html of css
thanx alvast
<?php
$admin = 'ultimatum22@hotmail.com';
$adminname = 'Ultimatum';
$subject = 'Request form';
$spam = 10;
?>
<?
if(isset($_COOKIE['Request'])) {
$show = true; echo 'You can send an email once in '.$spam.' minutes';
}
if(!isset($show)){
?>
<form method="post">
name:<br />
<input type="text" name="name"><br />
Email:<br />
<input type="text" name="mail"><br />
Email [confirm]:<br />
<input type="text" name="cmail"><br />
Colors: (min 1 hexcode, max 6 hexcodes)<br />
<input type="text" name="hexcolor1" maxlength="6">
<input type="text" name="hexcolor2" maxlength="6"><br /><br />
<input type="text" name="hexcolor3" maxlength="6">
<input type="text" name="hexcolor4" maxlength="6"><br /><br />
<input type="text" name="hexcolor5" maxlength="6">
<input type="text" name="hexcolor6" maxlength="6"><br /><br />
Coding in HTML or CSS:<br />
<input type="radio" name="html">HTML<br />
<input type="radio" name="css">CSS<br />
<input type="submit" name="submit" value="Submit"><br />
</form>
<br />
<?php
if (isset($_POST['submit'])) {
if (empty($name)) {
echo "You haven't fill in a name";
}elseif (empty($mail)) {
echo "You have to fill in an email address";
}elseif (empty($cmail)) {
echo "You have to confirm your email address";
}elseif (!preg_match("/^[A-Za-z0-9._\-]+\@[A-Za-z0-9._\-]+\.[A-Za-z]{2,4}$/", "$mail")) {
echo "Fill in a valid email address";
}elseif ($mail != $cmail) {
echo "The addresses you enterd are not the same";
}elseif (empty($html) and empty($css)){
echo "You have to choose between CSS and HTML";
}elseif (empty($hexcolor1)) {
echo "Fill at least 1 hexcolor in";
}else{
echo 'The email has been sent!';
setcookie('Request',1,time()+($spam*60));
$show = true;
}
}
}
?>
<?php $admin = 'ultimatum22@hotmail.com'; $adminname = 'Ultimatum'; $subject = 'Request form'; $spam = 10; ?> <? if(isset($_COOKIE['Request'])) { $show = true; echo 'You can send an email once in '.$spam.' minutes'; } ?> <form method="post"> name:<br /> <input type="text" name="name"><br /> Email:<br /> <input type="text" name="mail"><br /> Email [confirm]:<br /> <input type="text" name="cmail"><br /> Colors: (min 1 hexcode, max 6 hexcodes)<br /> <input type="text" name="hexcolor1" maxlength="6"> <input type="text" name="hexcolor2" maxlength="6"><br /><br /> <input type="text" name="hexcolor3" maxlength="6"> <input type="text" name="hexcolor4" maxlength="6"><br /><br /> <input type="text" name="hexcolor5" maxlength="6"> <input type="text" name="hexcolor6" maxlength="6"><br /><br /> Coding in HTML or CSS:<br /> <input type="radio" name="html">HTML<br /> <input type="radio" name="css">CSS<br /> <input type="submit" name="submit" value="Submit"><br /> </form> <br /> <?php if (isset($_POST['submit'])) { echo "You haven't fill in a name"; echo "You have to fill in an email address"; }elseif (empty($cmail)) { echo "You have to confirm your email address"; }elseif (!preg_match("/^[A-Za-z0-9._\-]+\@[A-Za-z0-9._\-]+\.[A-Za-z]{2,4}$/", "$mail")) { echo "Fill in a valid email address"; }elseif ($mail != $cmail) { echo "The addresses you enterd are not the same"; echo "You have to choose between CSS and HTML"; }elseif (empty($hexcolor1)) { echo "Fill at least 1 hexcolor in"; }else{ echo 'The email has been sent!'; $show = true; } } } ?>
|