Nothing happens when the User clicks the submit button

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kasl
    New Member
    • Jun 2007
    • 14

    #16
    Originally posted by ajaxrand
    Normally if you purchased a web hosting package with php support by default php mail facility is available. but sometimes they might disable it. you have to verify it with your service provider.

    Since you are trying this local machine web server (no doubts php is working,since it has executed this info.php file) you have to configure your php.ini file to work with php mail.

    Find the php.ini file from your php root dir.

    if you are on a windows box you can locate it under C:\WINDOWS or under your php installation dir.
    Hint: use the system search tool to locate it.
    then open it using a text editor, find this line.and enter your smtp host name
    Code:
    SMTP = mail.somehost.com
    smtp_port = 25
    You have to use a smtp server address and port here.if you are using a outlook or some kind of mail client in your box. use the smtp of that.
    I attempted to find the php.ini file with no luck (I am working on a Mac OSX).
    I even used the search tool to find it. The only php file I can access is the contact.php file that is listed in the above postings. I tried inputing the coding into the php.ini file and it didn't work. I am stumped and frustrated. My limited knowledge makes it even more frustrating. I really appreciate your help and patience. Thanks!!!

    Comment

    • ak1dnar
      Recognized Expert Top Contributor
      • Jan 2007
      • 1584

      #17
      Originally posted by kasl
      I attempted to find the php.ini file with no luck (I am working on a Mac OSX).
      I even used the search tool to find it. The only php file I can access is the contact.php file that is listed in the above postings. I tried inputing the coding into the php.ini file and it didn't work. I am stumped and frustrated. My limited knowledge makes it even more frustrating. I really appreciate your help and patience. Thanks!!!
      Since you executed the phpinfo script i believe that php engine is running under your web server.Problem is with the mail() function its not configured to send a mail.

      As you posted before still your smtp server address localhost.
      that means you can't send a mail with these settings.

      We'll try to fix it from application level instead of changing the php.ini file.

      Add these lines to the beginning of your mail script with keeping this configured as here,
      • Make sure to replace mail.yourdomain .com with existing smtp server address.
      • port is normally 25 by default. but verify it with your SMTP provider

      [CODE=php]<?php
      ini_set("smtp", "mail.yourdomai n.com");
      ini_set("smtp_p ort","25");
      ini_set("sendma il_from","fromY ou@yourdomain.c om");

      # Rest of the code for email script
      #
      #
      ?>[/CODE]

      Comment

      • kasl
        New Member
        • Jun 2007
        • 14

        #18
        Originally posted by ajaxrand
        Since you executed the phpinfo script i believe that php engine is running under your web server.Problem is with the mail() function its not configured to send a mail.

        As you posted before still your smtp server address localhost.
        that means you can't send a mail with these settings.

        We'll try to fix it from application level instead of changing the php.ini file.

        Add these lines to the beginning of your mail script with keeping this configured as here,
        • Make sure to replace mail.yourdomain .com with existing smtp server address.
        • port is normally 25 by default. but verify it with your SMTP provider

        [CODE=php]<?php
        ini_set("smtp", "mail.yourdomai n.com");
        ini_set("smtp_p ort","25");
        ini_set("sendma il_from","fromY ou@yourdomain.c om");

        # Rest of the code for email script
        #
        #
        ?>[/CODE]

        Thanks for sticking with me on this. I tried what you told me with no luck. I am seriously ready to pull out my hair. I know there is an answer and it is just frustrating me that I can't figure it out. I am afraid that I may be inputing your suggestions wrong so I have pasted what I have last inputed below.

        <?php
        ini_set("smtp", "smtpauth.earth link.net");
        ini_set("smtp_p ort","25");
        ini_set("sendma il_from","fromm e@earthlink.net ");

        $name = $HTTP_POST_VARS['Name'];
        $email = $HTTP_POST_VARS['Email'];
        $message = $HTTP_POST_VARS['Message'];
        $phone = $HTTP_POST_VARS['Phone'];

        $message = stripslashes($m essage);

        $sendTo = "me@earthlink.n et";
        $subject = "Message from Web Site";

        $msg_body = "Name: $name\n";
        $msg_body .= "E-Mail: $email\n";
        $msg_body .= "Comments: $message\n";
        $msg_body .= "Phone: $phone\n";

        $header_info = "From: ".$name." <".$email.">" ;

        mail($sendTo, $subject, $msg_body, $header_info);

        ?>

        Comment

        • Motoma
          Recognized Expert Specialist
          • Jan 2007
          • 3236

          #19
          Are you getting any error messages back from this script? Have you enabled error reporting as the top post in this forum describes?

          Comment

          • ak1dnar
            Recognized Expert Top Contributor
            • Jan 2007
            • 1584

            #20
            Originally posted by kasl
            Thanks for sticking with me on this. I tried what you told me with no luck. I am seriously ready to pull out my hair. I know there is an answer and it is just frustrating me that I can't figure it out. I am afraid that I may be inputing your suggestions wrong so I have pasted what I have last inputed below.
            ### CODE REMOVED - Ajaxrand
            Motoma is expecting something like this, give it a try.
            As i remember u failed to edit your php.ini, but this ini_set ( string $varname, string $newvalue ) is an alternative for that.
            [CODE=php]
            <?php
            error_reporting (E_ALL);
            ini_set('displa y_errors', True);
            ini_set("smtp", "smtpauth.earth link.net");
            ini_set("smtp_p ort","25");
            ini_set("sendma il_from","fromm e@earthlink.net ");

            # I made some changes here - Ajaxrand
            # Replaced $_HTTP_POST_VAR S with $_POST
            # and One more thing does your HTML form using POST method or GET method, Make sure to use POST.

            $name = $_POST['Name'];
            $email = $_POST['Email'];
            $message = $_POST['Message'];
            $phone = $_POST['Phone'];

            $message = stripslashes($m essage);

            $sendTo = "me@earthlink.n et";
            $subject = "Message from Web Site";

            $msg_body = "Name: $name\n";
            $msg_body .= "E-Mail: $email\n";
            $msg_body .= "Comments: $message\n";
            $msg_body .= "Phone: $phone\n";

            $header_info = "From: ".$name." <".$email.">" ;

            mail($sendTo, $subject, $msg_body, $header_info);

            ?>[/CODE]

            If you failed to execute this script with the expecting result.Send me the output of this script.

            function_exists .php

            [CODE=php]
            <?php
            if (function_exist s('mail')) {
            echo "mail() function available.<br />\n";
            } else {
            echo "mail() function not available.<br />\n";
            }

            ?>
            [/CODE]

            Comment

            • kasl
              New Member
              • Jun 2007
              • 14

              #21
              Originally posted by Motoma
              Are you getting any error messages back from this script? Have you enabled error reporting as the top post in this forum describes?
              no error messages at all...nothing at all happens.

              Comment

              • ak1dnar
                Recognized Expert Top Contributor
                • Jan 2007
                • 1584

                #22
                Why don't you post your html Form or host it some where and send us the link.
                Sometimes problem might be there at the HTML side.

                Comment

                • kasl
                  New Member
                  • Jun 2007
                  • 14

                  #23
                  Originally posted by ajaxrand
                  Motoma is expecting something like this, give it a try.
                  As i remember u failed to edit your php.ini, but this ini_set ( string $varname, string $newvalue ) is an alternative for that.
                  [CODE=php]
                  <?php
                  error_reporting (E_ALL);
                  ini_set('displa y_errors', True);
                  ini_set("smtp", "smtpauth.earth link.net");
                  ini_set("smtp_p ort","25");
                  ini_set("sendma il_from","fromm e@earthlink.net ");

                  # I made some changes here - Ajaxrand
                  # Replaced $_HTTP_POST_VAR S with $_POST
                  # and One more thing does your HTML form using POST method or GET method, Make sure to use POST.

                  $name = $_POST['Name'];
                  $email = $_POST['Email'];
                  $message = $_POST['Message'];
                  $phone = $_POST['Phone'];

                  $message = stripslashes($m essage);

                  $sendTo = "me@earthlink.n et";
                  $subject = "Message from Web Site";

                  $msg_body = "Name: $name\n";
                  $msg_body .= "E-Mail: $email\n";
                  $msg_body .= "Comments: $message\n";
                  $msg_body .= "Phone: $phone\n";

                  $header_info = "From: ".$name." <".$email.">" ;

                  mail($sendTo, $subject, $msg_body, $header_info);

                  ?>[/CODE]

                  If you failed to execute this script with the expecting result.Send me the output of this script.

                  function_exists .php

                  [CODE=php]
                  <?php
                  if (function_exist s('mail')) {
                  echo "mail() function available.<br />\n";
                  } else {
                  echo "mail() function not available.<br />\n";
                  }

                  ?>
                  [/CODE]
                  when I run function_exists .php this is what comes up.....

                  mail() function available.


                  when I run contact.php (by hand-typing it into my browser) using the above coding you gave me inserted into the contact.php file and I even tried it with the original coding I was given from the template designer, it runs and the form is sent to my email...I just get it without any name, email, comments, etc. inserted. So this tells me the coding for the form is fine, but the connection with the submit button to access the contact.php file is not working. When I click the submit button nothing happens (no error, nothing). There is no connection to the contact.php file. I am understanding the problem better but I don't know how to fix it :(

                  Comment

                  • ak1dnar
                    Recognized Expert Top Contributor
                    • Jan 2007
                    • 1584

                    #24
                    Originally posted by kasl
                    when I run function_exists .php this is what comes up.....

                    mail() function available.


                    when I run contact.php (by hand-typing it into my browser) using the above coding you gave me inserted into the contact.php file and I even tried it with the original coding I was given from the template designer, it runs and the form is sent to my email...I just get it without any name, email, comments, etc. inserted. So this tells me the coding for the form is fine, but the connection with the submit button to access the contact.php file is not working. When I click the submit button nothing happens (no error, nothing). There is no connection to the contact.php file. I am understanding the problem better but I don't know how to fix it :(

                    Show me the coding for Submit button, better to post entire html FORM.
                    Now it has verified the problem is with your HTML form.
                    mail function - OK
                    SMTP server - OK

                    Comment

                    • kasl
                      New Member
                      • Jun 2007
                      • 14

                      #25
                      Originally posted by ajaxrand
                      Show me the coding for Submit button, better to post entire html FORM.
                      Now it has verified the problem is with your HTML form.
                      mail function - OK
                      SMTP server - OK
                      I know this is going to sound odd, but I don't have the coding for the submit button. there are only 2 files that i have access to that have coding....the contact.php and the siteinfo.txt. The other files are .swf files or image galleries/slideshows. The two html files are for the intro page and then the main site. I don't know how or if I can access the html coding files.

                      Comment

                      • ronnil
                        Recognized Expert New Member
                        • Jun 2007
                        • 134

                        #26
                        seems like you're using flash then :)

                        what version of flashplayer do you have? and what version is the script written to work with?

                        sounds like it could be a bug in the OS compability (don't know anything about flash on MacOS)

                        Comment

                        • ak1dnar
                          Recognized Expert Top Contributor
                          • Jan 2007
                          • 1584

                          #27
                          Originally posted by kasl
                          I know this is going to sound odd, but I don't have the coding for the submit button. there are only 2 files that i have access to that have coding....the contact.php and the siteinfo.txt. The other files are .swf files or image galleries/slideshows. The two html files are for the intro page and then the main site. I don't know how or if I can access the html coding files.
                          You made us to run on different routines with out saying that you are using FLASH script/form for the user input section.No matter, after posting this much posts now i have to say, please contact your Flash developer and ask her to do like this.
                          • Create a flash form which uses POST method and the action for that form should be the path of your php script.
                          • As Ronnil suggest it should be compatible with your MacOS/Browser

                          Comment

                          • kasl
                            New Member
                            • Jun 2007
                            • 14

                            #28
                            Originally posted by ajaxrand
                            You made us to run on different routines with out saying that you are using FLASH script/form for the user input section.No matter, after posting this much posts now i have to say, please contact your Flash developer and ask her to do like this.
                            • Create a flash form which uses POST method and the action for that form should be the path of your php script.
                            • As Ronnil suggest it should be compatible with your MacOS/Browser
                            Many thanks to all for all of the advice. I apologize for my limited knowledge with all of this...I did not intend to frustrate anyone or intentionally leave out any information.

                            Comment

                            Working...