Guys... i am looking for a php script in which a users submit his email and/or name in a form and a link should be emailed to him to download the file.
just basic email verification.
Thanks in advance.
www.jm-experts.com
Guys... i am looking for a php script in which a users submit his email and/or name in a form and a link should be emailed to him to download the file.
just basic email verification.
Thanks in advance.
www.jm-experts.com
What do you mean by file a specific file by user or all users get the same file?
chetanmadaan (05-29-2009)
all users get the same file!
Thanks!
help please!?
Here is a small script that will email a link to an email address
You can use it by creating a Form in HTML and calling this as the action and using method="POST".
Remember that the fields in your Form need to be the same as those in the script, ie name and email.
Save this script as a PHP file with a name and that is the name to call for the action
PHP Code:<?php
//variables
//form contents
$txtName=$_POST['name'];
$txtDemande=$_POST['email'];
$txtName = str_replace(array("\n","\r"),'',$txtName);
$txtEmail = str_replace(array("\n","\r"),'',$txtMail);
$txtLink = "put your link here";
$Myemail="your email address here";
$message ="This is your Link :\t$txtLink\n
\n"
$subject = "Your Link is Here";
$mailheaders = "From: $Myemail <> \n";
$mailheaders .= "Reply-To: $Myemail\n\n";
$theiremail = $txtEmail;
//send mail
mail($theiremail, $subject, $message , $mailheaders);
?>
chetanmadaan (05-29-2009)
having this error!
Parse error: syntax error, unexpected T_VARIABLE in /homepages/46/d215152416/htdocs/clbiz78/form/form.php on line 15
you can see it here:
http://www.jm-experts.com/form/
It's missing a semicolon after the $message variable, here's a fixed version:
PHP Code:<?php
//variables
//form contents
$txtName=$_POST['name'];
$txtDemande=$_POST['email'];
$txtName = str_replace(array("\n","\r"),'',$txtName);
$txtEmail = str_replace(array("\n","\r"),'',$txtMail);
$txtLink = "put your link here";
$Myemail="your email address here";
$message ="This is your Link :\t$txtLink\n
\n";
$subject = "Your Link is Here";
$mailheaders = "From: $Myemail <> \n";
$mailheaders .= "Reply-To: $Myemail\n\n";
$theiremail = $txtEmail;
//send mail
mail($theiremail, $subject, $message , $mailheaders);
?>
chetanmadaan (05-29-2009)
alright... it's not showing any error right now but even not sending email.
http://www.jm-experts.com/form/
Sorry about that, typo on my part, I defined $_POST['mail'] into the wrong variable name, this version should send an email.
PHP Code:<?php
//variables
//form contents
$txtName=$_POST['name'];
$txtMail=$_POST['email'];
$txtName = str_replace(array("\n","\r"),'',$txtName);
$txtEmail = str_replace(array("\n","\r"),'',$txtMail);
$txtLink = "put your link here";
$Myemail="your email address here";
$message ="This is your Link :\t$txtLink\n
\n";
$subject = "Your Link is Here";
$mailheaders = "From: $Myemail <> \n";
$mailheaders .= "Reply-To: $Myemail\n\n";
$theiremail = $txtEmail;
//send mail
mail($theiremail, $subject, $message , $mailheaders);
?>
chetanmadaan (05-29-2009)
Bookmarks