php email form not showing content

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Derek
    New Member
    • Mar 2007
    • 12

    php email form not showing content

    hi could any one please help, I have a php form that is returning ok but it is only returing the varient headers and not the content. i am running my own plesk server running php ver 5.
    Best wishes
    Derek
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    derek welcome to TSDN!

    Originally posted by derek
    I have a php form that is returning ok but it is only returing the varient headers and not the content.
    I haven't the faintest idea what your problem is! What does: '..is returning ok..' mean? And what headers does it return? What do you mean by content?

    Please explain your problem in plain English.

    Ronald :cool:

    Comment

    • Derek
      New Member
      • Mar 2007
      • 12

      #3
      Hi thanks for getting back to me! below is the form contact.php then below that is the outcome of the sent form. and below that is the error logs?
      [php]
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
      <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
      <title>Contac t</title>
      </head>
      <?php
      $to = "derek@conc rete-crusher.co.uk";
      $subject = "Contact letter";
      $message = "Hello! \n";
      $message .= "Name: " . $_GET['name'] . "\n";
      $message .= "Phone: " . $_GET['phone'] . "\n";
      $message .= "E-mail: " . $_GET['email'] . "\n";
      $message .= $_GET['message'] . "\n";
      $headers = "From: " . $_GET['email'] . "\r\n" .
      "Reply-To: " . $_GET['email'] . "\r\n" .
      "X-Mailer: PHP/" . phpversion();

      mail($to, $subject, $message, $headers);

      ?>
      <html>
      <body bgcolor="#282E2 C">
      <div align="center" style="margin-top:60px;color: #FFFFFF;font-size:11px;font-family:Tahoma;f ont-weight:bold">
      Your message was sent. Thank you.
      </div>
      </body>
      </html>
      <script>resizeT o(300, 300)</script>r

      <body>
      </body>
      </html>
      [/php]
      email content
      Hello!
      Name:
      Phone:
      E-mail:

      log files
      Code:
      [client 149.254.192.192] PHP Notice: Undefined index: name in /var/www/vhosts/concrete-crusher.co.uk/httpdocs/contact.php on line 14, referer: http://www.concrete-crusher.co.uk/kandb.swf 
      [client 149.254.192.192] PHP Notice: Undefined index: phone in /var/www/vhosts/concrete-crusher.co.uk/httpdocs/contact.php on line 15, referer: http://www.concrete-crusher.co.uk/kandb.swf 
      [client 149.254.192.192] PHP Notice: Undefined index: email in /var/www/vhosts/concrete-crusher.co.uk/httpdocs/contact.php on line 16, referer: http://www.concrete-crusher.co.uk/kandb.swf 
      [client 149.254.192.192] PHP Notice: Undefined index: message in /var/www/vhosts/concrete-crusher.co.uk/httpdocs/contact.php on line 17, referer: http://www.concrete-crusher.co.uk/kandb.swf 
      [client 149.254.192.192] PHP Notice: Undefined index: email in /var/www/vhosts/concrete-crusher.co.uk/httpdocs/contact.php on line 18, referer: http://www.concrete-crusher.co.uk/kandb.swf 
      [client 149.254.192.192] PHP Notice: Undefined index: email in /var/www/vhosts/concrete-crusher.co.uk/httpdocs/contact.php on line 19, referer: http://www.concrete-crusher.co.uk/kandb.swf
      Last edited by ronverdonk; Mar 5 '07, 07:58 PM. Reason: code within tags!

      Comment

      • ronverdonk
        Recognized Expert Specialist
        • Jul 2006
        • 4259

        #4
        You don't really expect me to read that unstructured heap of code, do you?

        Read the Posting Guidelines at the top of this forum and comply with the rules for enclosing code within code or php tags!

        Ronald :cool:

        Comment

        • ronverdonk
          Recognized Expert Specialist
          • Jul 2006
          • 4259

          #5
          That cannot be the complete code. Where is the form on which the user enters his data and which calls the email-sending form when submitted?

          The errorslog only show NOTICES. I.e. you have an non-initialized $_GET array so the values you extract are from unknown array keys.

          Ronald :cool:

          Comment

          • Derek
            New Member
            • Mar 2007
            • 12

            #6
            Hi sorry about the tags i have worked very hard to get to this stage of trying to make a php form and apologise for any thing i have done wrong! the form is as follows :
            on (release) {
            _parent.getURL( "contact.php"," _blank",
            "GET");
            _parent.name="n ame:";
            _parent.phone=" phone:";
            _parent.email=" email:";
            _parent.message ="message:";
            }
            this is within FLASH

            Comment

            • Derek
              New Member
              • Mar 2007
              • 12

              #7
              hi Ronald
              if you could help me with this i would gladly pay you or make a contribution to your preferred charity

              what do you say

              Best wishes Derek

              Comment

              • ronverdonk
                Recognized Expert Specialist
                • Jul 2006
                • 4259

                #8
                We are all members of a forum for programmers helping programmers on a voluntary and stricly non-paid, non-commercial basis.

                We do not accept, directly or indirectly, any payments.

                We'll be glad to help if and when we can here!

                Ronald :cool:

                Comment

                • Derek
                  New Member
                  • Mar 2007
                  • 12

                  #9
                  ok but can you help with this one??
                  Derek

                  Comment

                  • ronverdonk
                    Recognized Expert Specialist
                    • Jul 2006
                    • 4259

                    #10
                    I don't know much about Flash, but from this code
                    Code:
                    on (release) {
                    _parent.getURL("contact.php","_blank",
                    "GET");
                    _parent.name="name:";
                    _parent.phone="phone:";
                    _parent.email="email:";
                    _parent.message="message:";
                    }
                    it appears that your form is exactly working like you want it to. In your variables you have set the values of your url to
                    Code:
                    name:
                    phone:
                    email:
                    message:
                    and that is what is exactly what is passed to your email handling form and is stored in the email itself.

                    What I think you forgot is to store the actual values in the url parameters in your Flash code, something like:
                    Code:
                    on (release) {
                    _parent.getURL("contact.php","_blank",
                    "GET");
                    _parent.name="John Doe";
                    _parent.phone="311 2456 443";
                    _parent.email="JohnDoe@ThatSite.com";
                    _parent.message="You have been registered ... blah ... blah ...";
                    }
                    Ronald :cool:

                    Comment

                    • Derek
                      New Member
                      • Mar 2007
                      • 12

                      #11
                      hi thanks for taking the time and replying but still not working
                      i cut and pasted your code and when i filled in the form it returned the usual but when i pressed the buttin again it returned ..
                      Hello!
                      Name: John Doe
                      Phone: 311 2456 443
                      E-mail: JohnDoe@ThatSit e.com
                      You have been registered ... blah ... blah ...

                      whaqt do you think of that?
                      Derek

                      Comment

                      • ronverdonk
                        Recognized Expert Specialist
                        • Jul 2006
                        • 4259

                        #12
                        As I said before: I don't know a thing about Flash! So I do not know what hitting the Flash button triggers. But at least the data from your url parameters is passed correctly to the email-handling form.

                        Now are you really sure that you have to hit the button twice? Is so, I think it must be a Flash problem that could be transferred to the Flash forum at this site.

                        Ronald :cool:

                        Comment

                        • Derek
                          New Member
                          • Mar 2007
                          • 12

                          #13
                          yes the first time i press the button it returns
                          Hello!
                          Name:
                          Phone:
                          E-mail:
                          and then the second time it returns your code (weired)
                          ill try the flash section

                          Thanks for your time

                          Comment

                          • ronverdonk
                            Recognized Expert Specialist
                            • Jul 2006
                            • 4259

                            #14
                            Do you want me to transfer this thread to the Flash forum?

                            Ronald :cool:

                            Comment

                            • iam_clint
                              Recognized Expert Top Contributor
                              • Jul 2006
                              • 1207

                              #15
                              The reason it didn't work the first time is because the script was cached... Second time it regot the file with the new script


                              In your flash you need to set your variables from the input boxes in your flash _root.text1.tex t for example not sure what yours are named.

                              Comment

                              Working...