ik geraak er neit uit maar wie ziet de fout in dit formuliertje , elke keer hij gegevens wil evrzenden verstuurt hij gwn een email , met geen afzender en geen onderwerp.
Formulier
VariabelenCode:<form name="form1" method="post" action="send_contact.php"> <table width="100%" border="0" cellspacing="1" cellpadding="3"> <tr> <td width="16%">Subject</td> <td width="2%">:</td> <td width="82%"><input name="subject" type="text" id="subject" size="50"></td> </tr> <tr> <td>Detail</td> <td>:</td> <td><textarea name="detail" cols="50" rows="4" id="detail"></textarea></td> </tr> <tr> <td>Name</td> <td>:</td> <td><input name="name" type="text" id="name" size="50"></td> </tr> <tr> <td>Email</td> <td>:</td> <td><input name="customer_mail" type="text" id="customer_mail" size="50"></td> </tr> <tr> <td> </td> <td> </td> <td><input type="submit" name="Submit" value="Submit"> <input type="reset" name="Submit2" value="Reset"></td> </tr> </table> </form>
Kan iemand me hier helpen ?Code:<?php // Contact subject $subject ="$subject"; // Details $message="$detail"; // Mail of sender $mail_from="$customer_mail"; // From $header="from: $name <$mail_from>"; // Enter your email address $to ='dj.atlantis@skynet.be '; $send_contact=mail($to,$subject,$message,$header); // Check, if message sent to your email // display message "We've recived your information" if($send_contact){ echo "We've recived your contact information"; } else { echo "ERROR"; } ?>
alvast bedankt
- contact form in php
-
06-11-2006, 17:41 #1
- Berichten
- 911
- Lid sinds
- 18 Jaar
contact form in php
-
-
06-11-2006, 18:02 #2
- Berichten
- 4
- Lid sinds
- 18 Jaar
PHP Code:<?php
// Contact subject
//$subject ="$subject";
$subject = $_POST['subject']; //ik neem aan dat je dit bedoelt?
// Details
//$message="$detail";
$message = $_POST['detail']; //ik neem aan dat je dit bedoelt?
// Mail of sender
//$mail_from="$customer_mail";
$mail_from = $_POST['customer_mail']; //ik neem aan dat je dit bedoelt?
// From
$name = $_POST['name'];
$header = "From: ".$name." <".$mail_from.">"; //variabelen buiten quotes!
// Enter your email address
$to = 'dj.atlantis@skynet.be';
$send_contact = mail($to,$subject,$message,$header);
// Check, if message sent to your email
// display message "We've recived your information"
if($send_contact){
echo "We've recived your contact information";
}
else {
echo "ERROR";
}
?>
-
06-11-2006, 20:24 #3
- Berichten
- 911
- Lid sinds
- 18 Jaar
dank je wel
-
06-11-2006, 22:52 #4
- Berichten
- 605
- Lid sinds
- 19 Jaar
Origineel gepost door M Groot
PHP Code:// Contact subject
//$subject ="$subject";
$subject = $_POST['subject']; //ik neem aan dat je dit bedoelt?
-
07-11-2006, 11:11 #5
- Berichten
- 911
- Lid sinds
- 18 Jaar
hoe bedoel je ?
groetjes
-
07-11-2006, 11:24 #6
- Berichten
- 605
- Lid sinds
- 19 Jaar
Als je niet controleert wat er in $_POST['subject'] staat, kan iemand die kwaad wil daar van alles in plaatsen. Complete spammails bijvoorbeeld.
Zie http://www.securephpwiki.com/index.php/Email_Injection
Plaats een
- + Advertentie
- + Onderwerp
Marktplaats
Webmasterforum
- Websites algemeen
- Sitechecks
- Marketing
- Domeinen algemeen
- Waardebepaling
- CMS
- Wordpress
- Joomla
- Magento
- Google algemeen
- SEO
- Analytics
- Adsense
- Adwords
- HTML / XHTML
- CSS
- Programmeren
- PHP
- Javascript
- JQuery
- MySQL
- Ondernemen algemeen
- Belastingen
- Juridisch
- Grafisch ontwerp
- Hosting Algemeen
- Hardware Info
- Offtopic