Php script juist, lege emails komen aan. (Opgelost)
DieHard - 05/04/2008 14:32 (laatste wijziging 05/04/2008 14:58)
PHP interesse
Ik kom er helaas niet uit wat er fout is.
Dit is het contact.php
<?php
$to = "email";
$subject = $_POST['subject'] ;
$bericht = $_POST['message'] ;
$header = "From: " . $_POST['name'] . " <" . $_POST['email'] . ">\n";
$header .= "Reply-To: " . $_POST['name'] . " <" . $_POST['email'] . ">\n";
$header .= "X-Priority: 1";
mail ($to, $subject, $bericht, $header);
?>
<SCRIPT language="JavaScript">
<!--
window.location="http://website";
//-->
</SCRIPT>
<?php
$to = "email" ;
$subject = $_POST [ 'subject' ] ;
$bericht = $_POST [ 'message' ] ;
$header = "From: " . $_POST [ 'name' ] . " <" . $_POST [ 'email' ] . ">\n " ;
$header .= "Reply-To: " . $_POST [ 'name' ] . " <" . $_POST [ 'email' ] . ">\n " ;
$header .= "X-Priority: 1" ;
mail ( $to , $subject , $bericht , $header ) ; ?>
<SCRIPT language="JavaScript">
<!--
window.location="http://website";
//-->
</SCRIPT>
Dit staat in het contact.html
<form id="form" action="contact.php" method="post">
<form id = "form" action = "contact.php" method = "post" >
Waarschijnlijk is er iets fout aan, maar ik weet niet wat.
Alvast bedankt,
Groeten DieHard
/// edit
Sorry eerst was het zonder echo en toen werkte het ook niet.
Met echo gaat de browser naar het contact.php toe.
titjes schreef:
CODETAGS gebruiken!!!
19 antwoorden
Gesponsorde links
DieHard - 05/04/2008 14:36 (laatste wijziging 05/04/2008 14:37)
PHP interesse
DieHard - 05/04/2008 14:43 (laatste wijziging 05/04/2008 14:44)
PHP interesse
<?php
$to = "email@hotmail.com";
$subject = $_POST['subject'] ;
$bericht = $_POST['message'] ;
$header = "From: " . $_POST['name'] . " <" . $_POST['email'] . ">\n";
$header .= "Reply-To: " . $_POST['name'] . " <" . $_POST['email'] . ">\n";
$header .= "X-Priority: 1";
mail ($to, $subject, $bericht, $header);
?>
<SCRIPT language="JavaScript">
<!--
window.location="http://hotmail.com";
//-->
</SCRIPT>
<?php
$to = "email@hotmail.com" ;
$subject = $_POST [ 'subject' ] ;
$bericht = $_POST [ 'message' ] ;
$header = "From: " . $_POST [ 'name' ] . " <" . $_POST [ 'email' ] . ">\n " ;
$header .= "Reply-To: " . $_POST [ 'name' ] . " <" . $_POST [ 'email' ] . ">\n " ;
$header .= "X-Priority: 1" ;
mail ( $to , $subject , $bericht , $header ) ; ?>
<SCRIPT language="JavaScript">
<!--
window.location="http://hotmail.com";
//-->
</SCRIPT>
DieHard - 05/04/2008 14:49 (laatste wijziging 05/04/2008 14:49)
PHP interesse
bij regel 2? echo ervoor ? $to = echo "email@hotmail.com"; ???
DieHard - 05/04/2008 14:54
PHP interesse
Nee er komt geen true te staan, email komt nog steeds aan, maar leeg.
DieHard - 05/04/2008 14:57 (laatste wijziging 05/04/2008 15:12)
PHP interesse
<div id="textveld">
<h3>The ContactForm:</h3>
<form id="form" action="contact.php" method="post">
<table width="80%" border="0">
<tr>
<td>Name:</td>
<td><input type="text" name="Name" id="Name" /></td>
</tr>
<td> </td>
<tr>
<td height="23">Email Address:</td>
<td><input type="text" name="Email" id="Email" /></td>
</tr>
<td> </td>
<tr>
<td height="23">Subject:</td>
<td><input type="text" name="Subject" id="Subject" /></td>
</tr>
<td> </td>
<tr>
<td>Message:</td>
<td><textarea name="textarea" id="textarea" cols="50" rows="6"></textarea></td>
</tr>
<tr>
<br />
<td height="23"><input type="submit" name="button" id="button" value="Submit" />
<br />
<td><input type="reset" name="button2" id="button2" value="Reset" /></td>
</form>
</div>
</tr>
</table>
<h3 > The ContactForm:
</ h3 > <form id = "form" action = "contact.php" method = "post" > <table width = "80%" border = "0" > <td ><input type = "text" name = "Name" id = "Name" / ></ td >
<td height = "23" > Email Address:
</ td > <td ><input type = "text" name = "Email" id = "Email" / ></ td >
<td height = "23" > Subject:
</ td > <td ><input type = "text" name = "Subject" id = "Subject" / ></ td >
<td height = "23" ><input type = "submit" name = "button" id = "button" value = "Submit" / > <td ><input type = "reset" name = "button2" id = "button2" value = "Reset" / ></ td >
of moet het in html 4 code?
titjes schreef:
Wederom: CODETAGS gebruiken!!!
DieHard - 05/04/2008 16:23 (laatste wijziging 05/04/2008 16:25)
PHP interesse
Ik ga maar verder in dit topic met een vervolg vraag. Ik heb meerdere dingen proberen toe te voegen zoals een dropbox en een aanvinkbox, maar hierdoor komt er geen email meer aan. Heb ik het zo niet goed gedaan?
<?php
$to = "email@hotmail.com";
$subject = $_POST['subject'] ;
$select1 = $_POST['select1'] ;
$select2 = $_POST['select2'] ;
$firstname = $_POST['firstname'] ;
$lastname = $_POST['lastname'] ;
$remarks = $_POST['message'] ;
$newsletter = $_POST['newsletter'] ;
$header = "From: " . $_POST['name'] . " <" . $_POST['email'] . ">\n";
$header .= "Reply-To: " . $_POST['name'] . " <" . $_POST['email'] . ">\n";
$header .= "X-Priority: 1";
mail ($to, $subject, $select1, $select2, $firstname, $lastname, $remarks, $newsletter);
?>
<?php
$to = "email@hotmail.com" ;
$subject = $_POST [ 'subject' ] ;
$select1 = $_POST [ 'select1' ] ;
$select2 = $_POST [ 'select2' ] ;
$firstname = $_POST [ 'firstname' ] ;
$lastname = $_POST [ 'lastname' ] ;
$remarks = $_POST [ 'message' ] ;
$newsletter = $_POST [ 'newsletter' ] ;
$header = "From: " . $_POST [ 'name' ] . " <" . $_POST [ 'email' ] . ">\n " ;
$header .= "Reply-To: " . $_POST [ 'name' ] . " <" . $_POST [ 'email' ] . ">\n " ;
$header .= "X-Priority: 1" ;
mail ( $to , $subject , $select1 , $select2 , $firstname , $lastname , $remarks , $newsletter ) ; ?>
<form id="form" action="contact.php" method="post">
<table width="80%" border="0">
<tr>
<td height="23">Subject:</td>
<td><input type="text" name="subject" id="subject" /></td>
</tr>
<tr>
<td>Select information:</td>
<td><select name="select1" id="select1">
<option>General information</option>
<option>Detailled information</option>
</select> </td>
</tr>
<tr>
<td>Age:</td>
<td><select name="select2" id="select2">
<option>Under 18 year</option>
<option>Above 18 year</option>
</select> </td>
</tr>
</tr>
<tr>
<td>Email Address:</td>
<td><input type="text" name="email" id="email" /></td>
</tr>
</tr>
<tr>
<td>First Name:</td>
<td><input type="text" name="firstname" id="firstname" /></td>
</tr>
<tr>
<td height="23"><p>Last Name:</p> </td>
<td><input type="text" name="lastname" id="lastname" /></td>
</tr>
<tr>
<td>Remarks:</td>
<td><textarea name="message" id="textarea" cols="45" rows="5"></textarea></td>
</tr>
<tr>
<tr>
<td height="23">Send me:</td>
<td><input name="newsletter" type="checkbox" id="newsletter" value="Yes" />
Our Newsletter!</td>
</tr>
<form id = "form" action = "contact.php" method = "post" > <table width = "80%" border = "0" >
<td height = "23" > Subject:
</ td > <td ><input type = "text" name = "subject" id = "subject" / ></ td >
<td > Select information:
</ td > <td ><select name = "select1" id = "select1" >
<td ><select name = "select2" id = "select2" >
<td ><input type = "text" name = "email" id = "email" / ></ td >
<td ><input type = "text" name = "firstname" id = "firstname" / ></ td >
<td height = "23" ><p > Last Name:
</ p > </ td > <td ><input type = "text" name = "lastname" id = "lastname" / ></ td >
<td height = "23" > Send me:
</ td > <td ><input name = "newsletter" type = "checkbox" id = "newsletter" value = "Yes" / >
DieHard - 05/04/2008 17:29
PHP interesse
Ja alle gekozen elementen uit het form wil ik versturen.
Dus alles moet dan message zijn?
DieHard - 05/04/2008 17:37 (laatste wijziging 05/04/2008 17:37)
PHP interesse
Oké en hoe doe ik dat dan?
Bij alla form elementen die ik dan wil versturen
<td><input type="text" name="firstname" id="firstname" /></td>
<td ><input type = "text" name = "firstname" id = "firstname" / ></ td >
moet dus worden
<td><input type="text" name="message" id="firstname" /></td>
<td ><input type = "text" name = "message" id = "firstname" / ></ td >
Als ik het goed begrijp?
DieHard - 05/04/2008 21:09
PHP interesse
Om eerlijk te zijn, begijp ik nou niet wat hier nou anders aan is dan wat ik al heb.
DieHard - 06/04/2008 13:38 (laatste wijziging 06/04/2008 13:39)
PHP interesse
Oké dat maakt het het wel duidelijker ja
Dat snap ik nu, zoiets dus
-->
$to = "email@hotmail.com";
$subject = $_POST['subject'] ;
$var1 = $_POST['select1'] ;
$var2 = $_POST['select2'] ;
$var3 = $_POST['select3'] ;
$var4 = $_POST['select4'] ;
$verzamel_var = $var1. $var2. $var3. $var4.;
// Moeten hier dan geen komma's tussen?
// Moet dat echo dan ook altijd?
// $verzamel_var en hoe plaats je al die verzamelingen dan naar het bericht?
$header = "From: " . $_POST['name'] . " <" . $_POST['email'] . ">\n";
$header .= "Reply-To: " . $_POST['name'] . " <" . $_POST['email'] . ">\n";
$header .= "X-Priority: 1";
mail ($to, $subject, $message, $header);
$to = "email@hotmail.com" ;
$subject = $_POST [ 'subject' ] ;
$var1 = $_POST [ 'select1' ] ;
$var2 = $_POST [ 'select2' ] ;
$var3 = $_POST [ 'select3' ] ;
$var4 = $_POST [ 'select4' ] ;
$verzamel_var = $var1 . $var2 . $var3 . $var4 .;
// Moeten hier dan geen komma's tussen?
// Moet dat echo dan ook altijd?
// $verzamel_var en hoe plaats je al die verzamelingen dan naar het bericht?
$header = "From: " . $_POST [ 'name' ] . " <" . $_POST [ 'email' ] . ">\n " ;
$header .= "Reply-To: " . $_POST [ 'name' ] . " <" . $_POST [ 'email' ] . ">\n " ;
$header .= "X-Priority: 1" ;
mail ( $to , $subject , $message , $header ) ;
DieHard - 06/04/2008 20:04
PHP interesse
Nouja ik heb hulp gehad van een vriend..
Ik post het hier wel even hoe het is gedaan, want het kan veel makkelijker. Eindelijk werk het! Toch bedankt man voor je hulp
$to = "support@diehardservers.com";
$subject = $_POST['subject'] ;
$bericht = $_POST['message'] ;
$message = "select1: ". $_POST['select1'] . ">\n";
$message .= " select2 ".$_POST['select2'] . ">\n";
$message .= " select3 ".$_POST['select3'] . ">\n";
// etc. etc.
$to = "support@diehardservers.com" ;
$subject = $_POST [ 'subject' ] ;
$bericht = $_POST [ 'message' ] ;
$message = "select1: " . $_POST [ 'select1' ] . ">\n " ;
$message .= " select2 " . $_POST [ 'select2' ] . ">\n " ;
$message .= " select3 " . $_POST [ 'select3' ] . ">\n " ;
// etc. etc.
Gesponsorde links
Dit onderwerp is gesloten .