PDA

View Full Version : Webform with php



Albert
March 26th, 2004, 17:57
I have a free page with http://www.club-server.de/main.php?id=detail (package free server), which allows php only and I would like to have something like formmail, which needs perl. Are there php-only solutions? I only want that a small message is forwarded to an email-address, which cannot be harvested by spammers.

Wojtek
March 26th, 2004, 18:46
mail($to, $subject, $body);

bloodyveins
March 27th, 2004, 01:56
do you mean, creating a formmail instead of a link to send mail (<a href="mailto:user@email.com">user@email.com</a>)

if so, the answer is yes. there are php solutions for it.

1.since php support email sending (through command line: sendmail -t -i by default) , you can create a form which is then processed with php scripts.
eg: (very simple one)
<form action="sendmail.php" method="post">
<input name="title" />
<input name="message" />
<input type="button" value="Submit" />
</form>

and then


//File sendmail.php

$to = "user@email.com";

//Do some regex check
//Bla..bla..bla

//If regex check is OK
@mail($to,$_POST['title'],$_POST['message'],"From: admin@mysite.com");


2.Encrypt email address or convert email address to an image so that webbot cannot crawl it.