Advanced Search

Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: PHp script to email download link

  1. #1
    Join Date
    Apr 2008
    Location
    Little Office!
    Posts
    80
    Thanks
    15
    Thanked 0 Times in 0 Posts

    Default PHp script to email download link

    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

  2. #2
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    What do you mean by file a specific file by user or all users get the same file?

  3. The Following User Says Thank You to bluewalrus For This Useful Post:

    chetanmadaan (05-29-2009)

  4. #3
    Join Date
    Apr 2008
    Location
    Little Office!
    Posts
    80
    Thanks
    15
    Thanked 0 Times in 0 Posts

    Default

    all users get the same file!

    Thanks!

  5. #4
    Join Date
    Apr 2008
    Location
    Little Office!
    Posts
    80
    Thanks
    15
    Thanked 0 Times in 0 Posts

    Default

    help please!?

  6. #5
    Join Date
    Apr 2009
    Location
    Cognac, France
    Posts
    400
    Thanks
    2
    Thanked 57 Times in 57 Posts

    Default

    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);
        
    ?>

  7. The Following User Says Thank You to forum_amnesiac For This Useful Post:

    chetanmadaan (05-29-2009)

  8. #6
    Join Date
    Apr 2008
    Location
    Little Office!
    Posts
    80
    Thanks
    15
    Thanked 0 Times in 0 Posts

    Default

    having this error!

    Parse error: syntax error, unexpected T_VARIABLE in /homepages/46/d215152416/htdocs/clbiz78/form/form.php on line 15

  9. #7
    Join Date
    Apr 2008
    Location
    Little Office!
    Posts
    80
    Thanks
    15
    Thanked 0 Times in 0 Posts

    Default

    you can see it here:

    http://www.jm-experts.com/form/

  10. #8
    Join Date
    Sep 2008
    Location
    Bristol - UK
    Posts
    842
    Thanks
    32
    Thanked 132 Times in 131 Posts

    Default

    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);
        
    ?>

  11. The Following User Says Thank You to Schmoopy For This Useful Post:

    chetanmadaan (05-29-2009)

  12. #9
    Join Date
    Apr 2008
    Location
    Little Office!
    Posts
    80
    Thanks
    15
    Thanked 0 Times in 0 Posts

    Default

    alright... it's not showing any error right now but even not sending email.


    http://www.jm-experts.com/form/

  13. #10
    Join Date
    Apr 2009
    Location
    Cognac, France
    Posts
    400
    Thanks
    2
    Thanked 57 Times in 57 Posts

    Default

    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); 
        
    ?>

  14. The Following User Says Thank You to forum_amnesiac For This Useful Post:

    chetanmadaan (05-29-2009)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •