PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi
I have a problem with my simple PHP Mailform. Since I moved it on a new server it doesen't work anymore. Maybe it's another PHP Version, I don't know. The mail sending works, but I don't get the content. Can someone help?
It looks like that:
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I have a problem with my simple PHP Mailform. Since I moved it on a new server it doesen't work anymore. Maybe it's another PHP Version, I don't know. The mail sending works, but I don't get the content. Can someone help?
btw:
+ How about using the pre-increment operator (++$z) instead of filling multiple lines?
+ Don't put the email address of the sender in the mail header unless you've validated it.
+ Even though implode accepts the arguments in any order, I'd recommend using implode("",$b).
Last edited by aerodromoi on Sat Jul 15, 2006 7:19 am, edited 1 time in total.
btw:
+ How about using the pre-increment operator (++$z) instead of filling multiple lines?
+ Don't put the email address of the sender in the mail header unless you've validated it.
+ Even though implode accepts the arguments in any order, I'd recommend using implode("",$b).
Thanks for your help. Yes it is PHP5 now!
But I still doesen't get it work. How should it look the way you recommend? Sorry, I'm a PHP Newbie.
<?php
// fetch the variables from the post array
$firma = $_POST['firma'];
$letter = $_POST['letter'];
$realname = $_POST['realname'];
$senderemail = $_POST['senderemail'];
/* Email an Betreiber der Site */
mail("name@domain.ch","Kontaktformular",$letter,"from:$senderemail");
?>
Last edited by oliver23 on Sat Jul 15, 2006 9:46 am, edited 1 time in total.
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
this ist my html form:
[syntax="html"]<head>
<title>Untitled Document</title>
</head>
<body>
<h2>Ihre Anfrage ist uns willkommen!</h2>
<p>Was können wir für Sie tun?</p>
<form method="post" action="senden.php" name="Kontaktformular">
<h2>Ihre Angaben</h2>
<p></p>
<table width="525" border="0" cellspacing="1" cellpadding="0">
<tr>
<td valign="top" width="100" class="tabdunkel">Firma
</td>
<td valign="top" class="tabdunkel">
<input type="text" name="firma" class="inputfeld" />
</td>
</tr>
<tr>
<td valign="top" width="100" class="tabdunkel">Name *
</td>
<td valign="top" class="tabdunkel">
<input type="text" name="realname" class="inputfeld" />
</td>
</tr>
<tr>
<td valign="top" width="100" class="tabdunkel">E-Mail *
</td>
<td valign="top" class="tabdunkel">
<input type="text" name="senderemail" class="inputfeld" />
</td>
</tr>
</table>
<p><input type="submit" name="submit" value="Senden" class="button" /></p>
</form>
</body>
</html>
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
oliver23 wrote:
What I have now ist the following, and the good thing is I see the from email now. But not the content.
Because there is no such thing as a textarea for any kind of message in your html form.
You've only got three input fields (for the name, the company and an email address).
aerodromoi wrote:
Because there is no such thing as a textarea for any kind of message in your html form.
You've only got three input fields (for the name, the company and an email address).
Yes, all I want is to send an Email with this 3 Information to my emailadress:
aerodromoi wrote:
Because there is no such thing as a textarea for any kind of message in your html form.
You've only got three input fields (for the name, the company and an email address).
Yes, all I want is to send an Email with this 3 Information to my emailadress:
aerodromoi wrote:
Just to get you started: I've modified the code somewhat to check whether someone has tried to insert additional to/cc/bcc fields.
Gern geschehen!
Perfekt!
One more question, is it possible to forward it to another site (danke.html) if the sending was okay? A redirect instead of