Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > RocketCake
Contact Form Antispam - supplement subject text

heinzp
Registered User
Quote
2024-09-08 13:43:54

In order to better identify spam, I would like to supplement the standard text "Contact form request" with the content of the name field.

How does that work? I can't find an attribute field.


niko
Moderator
Quote
2024-09-09 08:58:16

You can just add any form field to the contact form, and set it's name to whatever you like - this will then turn up in the email you get.


heinzp
Registered User
Quote
2024-09-09 11:18:43

I know this, but I don't want to open the mail for nothing..

If the mailing address is in the subject field, I can delete the mail immediately or have you a better idea?.


niko
Moderator
Quote
2024-09-09 13:13:01

Ah, now I understand, the subject of the email you get should include the name field. Hm, with the component there is no way, but you can create an own contact form (just like in the contact form tutorial) and in the line

mail("youremail@example.com", "Contact form request", $text);


replace this part:

"Contact form request"


with

"Contact form request" . $_POST['name']


which only works if your field is named "name".


heinzp
Registered User
Quote
2024-09-22 11:46:40

Who can help? - Where is the mistake? The worth of the name field is not in the mail subject - Thanks

foreach($_POST as $name => $value)
{
$text .= "$name : $value\n";
}
if ($text != "")
{ ...
mail("*****@online.de", "Anfrage von Homepage - " . $_POST['name'], $text);
}[


erik
Registered User
Quote
2024-09-23 10:33:20

How did you name the name field? If it's for example "Name" or "Vorname", then you need to set it where the code says 'name', so for example then 'Vorname' or 'Name' - then it will work.


heinzp
Registered User
Quote
2024-09-23 14:41:55

Thanks - now it works

I didn't change the name of the standard field, the right name is "NameField" and not name


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "In?ernational" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact