Announcement

Collapse
No announcement yet.

PHP Guru Please

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Originally posted by jont
    OK! Enough is enough already.. Lee .. bin it off and use a form mail script .. stop p*****g into the wind!

    I can say that as a friend
    Jonty

    I can do this in one language - ASP.net, that is all, i am on a Linux server, if you think using form mail will be any less pissing in the wind than what i currently have, you are grossly mistaken. It's all double dutch to me unless on a Windows server.

    It does make me laugh though i must admit, i have one simple field in which i ask for an email address, if filled out and submit is clicked, email it to me - that is all lol. In days gone by, there'd have been flying laptops, i'm getting too chilled in my old age.

    Still baffles me that i cannot go to a resource, that says save this file as blah blah and point to it via blah blah and upload and it will work. Or how a php file works on two sites and then fails when you go live, quite laughable.

    Comment


      #17
      What I would do here is:

      1. change method="get" to method="post"

      2. Add this line at the top of the php mailing script:

      $email = $_POST['email'];

      This should get it working.

      Mike
      -----------------------------------------

      First Tackle - Fly Fishing and Game Angling

      -----------------------------------------

      Comment


        #18
        Hi Lee

        The following should work

        Code:
        <form action="http://www.smithfieldwine.com/form/smithfield-eletter.php" method="post">
        <input name="email" type="text" size="18" id="email"><input type="submit" name="Submit" value="Submit">
        </form>
        Code:
        <?php
        //send email
        $email = $_POST['email'];
        
        $headers .= "From: $email<>\r\n";
        //message body
        $recipient = "enquiries@websitedesigned.co.uk";	
        $message .= "I would like to receive the Smithfield E-letter" . "\n\n";	
        $message .= "Email: " . $email . "\n";
        //build email
        $body = $message;
        //sends email
        $subject = "E-Letter Request";
        mail($recipient, $subject, $body, $headers) or die("couldn't send the email"); 
        header("Location: http://www.smithfieldwine.com/acatalog/thank-you.html");
        ?>
        Regards

        Mark

        Comment


          #19
          Mark & Mike

          Just wanted to say thank you very much, you both came up with the same solution in the end and it works perfect. I really appreciate your time spared on this - i have a beaming smile now.

          I presume that somehow, this:

          $email = $_POST['email'];

          was ok missed out on the old hosting and my test hosting, but not ok to miss out on the final hosting - the server setting that Mark referred to i guess.

          Anyway, once again, cheers guys, got me out of an annoying hole.

          Comment

          Working...
          X