25 Replies Latest reply on Nov 15, 2007 3:07 AM by Sketchsta

    To ALL the REALLLLLY smart people.

    Sketchsta Level 1
      Hi all, I need some help with PHP on a Windows server.
      I know this isn't the best place to ask for this kind of help, but im desperate for an answer.

      The problem is as follows..
      My boss has just installed PHP on his servers, (by my request) I needed it done because I only know how to make contact forms using Flash and PHP. The problem is that the Contact forms are not getting sent to email.

      Here is the form i need to be working asap. Planit Venus In the contact page.

      I KNOW this form works, as I have tested it on a different server, and it sends with no problems.

      For all the people who know PHP reasonably well, here is the phpinfo.php
      Are some of the settings wrong?
      Do i need something separate to get it to send emails?

      I have been to www.php.net for the past 2 days, reading all the documentations, but i couldn't find the solution.
      If anyone has some knowledge of what could be happening, or not happening, PLEASE let me know. I need to have this working asap.

      Thanx in advance for any help offered.
        • 1. Re: To ALL the REALLLLLY smart people.
          clbeech Level 3
          It looks like you need to have a lot more of the 'configuration commands' turn on and installed, I don't remember which specifically off hand at the moment, but this would be the area I'd look into.

          Good luck :)
          • 2. Re: To ALL the REALLLLLY smart people.
            Sketchsta Level 1
            yeah i noticed that alot of things were turned off, but thats the default installation. I figured the default would include the most common options, Mail included.

            i'll tell my boss to turn all of them on. see how that goes.

            thanx alot.
            • 3. Re: To ALL the REALLLLLY smart people.
              scrfix Level 1
              Your links in your post need to be changed. They currently lead to:
              https://http//www.planitvenus.com.au on both links. which will go nowhere.

              The Enter website link over on this end has a huge delay before I can actually click on it to enter the website. I am in Florida, USA.

              Can you post the code for your Flash Form talking to PHP and your PHP Handler?

              I am just learning AS3 however I can look at PHP. I am not a god at PHP but I can write forms and handlers.

              Wayne
              • 4. Re: To ALL the REALLLLLY smart people.
                Sketchsta Level 1
                The contact form works no problems, I've tried this exact same form on a different server and it works no problems. But heres the code anyway, maybe you can see something that will help my problem with this server.

                -Clbeech
                I've turned on all the options i could and tried again.. but no luck. I dont know what most of them are, so I went back to the default values for all.
                • 5. Re: To ALL the REALLLLLY smart people.
                  funkysoul Level 4
                  mostlikely, your flash can't find the php script, have you checked it that is working correctly?
                  Otherwise, have a look at this tutorial, download the sample files place them on your server and change them to test it out and see if everything's working.
                  • 6. Re: To ALL the REALLLLLY smart people.
                    nonybd Level 1
                    Hi,

                    I was just wondering how you did that scroller on the reviews page? Thanks. I've been trying to make my own scroller for a while, and haven't figured it out...yet.

                    Thanks
                    • 7. Re: To ALL the REALLLLLY smart people.
                      clbeech Level 3
                      @Sketchsta: just a hunch, I've been working for a while with another poster, that has been having trouble recieve mail from a similar program. I've tested the system many time from my own servers and have no problems with it, it sends just fine. However he's also sending to a 'yahoo.com' mailbox, I noticed that yours is as well. My hunch here is that maybe yahoo has a span filter that is blocking the php scripted mail! try the code from your server sending to another mailbox that's not yahoo based.
                      • 8. Re: To ALL the REALLLLLY smart people.
                        Sketchsta Level 1
                        I am quite sure that the problem I'm having is from the server, more specifically from the PHP support on the server.
                        --Funkysoul
                        the PHP file is in the same directory as the SWF. Im sure it's reading it, it's just not getting a response maybe?

                        --clbeech
                        The thought had crossed my mind aswell, and I tried to use a hotmail.com mailbox, and my own work email (POP3), none of which would work.
                        So I still think that the problem must be somewhere in the PHP support for the server. Here is the same site on a different server, you can see what is supposed to happen within Flash when a) the data has been sent to the PHP file, b) when Flash recieves confirmation from PHP.
                        Same site, different server


                        -- nonybd
                        here is the scroller code i used. Nothing special, but it does the job.
                        you need:
                        a) movieClip called "mainField" which holde the content you wish to scroll.
                        b) two buttons called "scrollUp" and "scrollDn"

                        you will also need to change the scroll values to suite your own needs. If you have a look, there is a trace function there which traces the current _y value of mainField. Use that trace to get the values you need.

                        • 9. Re: To ALL the REALLLLLY smart people.
                          Sketchsta Level 1
                          any other ideas?? anyone?

                          www.php.net still hasnt gotten back to me with an answer.
                          • 10. Re: To ALL the REALLLLLY smart people.
                            clbeech Level 3
                            I dunno Sketchsta, if you turned on all of the PHP configuration prefs, it should have worked, doesn't seem to make sense. was hoping it was the yahoo thing (for the other guy too) maybe even though you'd truned them all on, the one needed was missing? but this wouldn't really make sense either, considering that emailing is 101 functionality, I'm sure it must be included in the basic package install, strange.

                            One thought (this is stupid, 'cuz it works from you're other servers) but maybe this is needed in the email header, worth a try:
                            • 11. Re: To ALL the REALLLLLY smart people.
                              Sketchsta Level 1
                              i'll give that a try, see how it goes.

                              here is the tester you sent.

                              *************************************************************
                              To: seul_kof@yahoo.com
                              Subject: Comments/Bookings
                              From: "tester" <testing@mydomain.com> Add to Address BookAdd to Address Book Add Mobile Alert
                              Date: Wed, 24 Oct 2007 23:47:30 +0800

                              Name: tester
                              Phone Number: 19828398
                              Fax Number: 983249829
                              Mobile Number: 98129398

                              Enquiry: just wondering if this is working trying this as a test.
                              cbeech

                              *********************************************************************
                              • 12. Re: To ALL the REALLLLLY smart people.
                                Sketchsta Level 1
                                Nope, no luck with the header either. =(

                                This is tooooo frustrating.... all this trouble for PHP support on windows... grrr!!!
                                i should charge my boss for the pain i feel in my head from trying to fix this PHP troubles on his servers.... this is his responsibility, isn't it??
                                • 13. Re: To ALL the REALLLLLY smart people.
                                  clbeech Level 3
                                  huh, crap. Dunno, seems like it should work just fine. did you post on the php forum? someone must know over there. sorry i couldn't help you.
                                  • 14. Re: To ALL the REALLLLLY smart people.
                                    fermp
                                    Have you thought of just chucking this particular script on another server to handle this job? This could be a quick fix for now to get everything up and running until you have answers. You can get a yahoo account with .php for like $7 a month do what you need and then fix the problem with your own server at your leisure.
                                    • 15. Re: To ALL the REALLLLLY smart people.
                                      scrfix Level 1
                                      Your PHP look okay but where is your handler for the email? What are you using to send it with?

                                      All I see if a form that gives a response of passed or failed? How are you sending the email?

                                      Wayne
                                      • 16. Re: To ALL the REALLLLLY smart people.
                                        Sketchsta Level 1
                                        -- fermp
                                        Thats what I have been doing since i started working with this guy. All php scripts were on my server, while the forms were on his. This worked great, and with no hassels. Until he changed some things around on his server which blocked communications with my server somehow.
                                        eg.. If i have a swf on his server, which is driven by a XML page on my server, his server doesn't allow the swf to get or send anything from the XML on my server.
                                        I cursed my own boss when i first found out. I dont know what he did, nor why he did it....idiot!!!

                                        -- SpectacularStuff
                                        I'm affraid I dont know what you mean. I'm no pro of actionscript or PHP, but this form i worked on for about 3 weeks a while back, i got it to work perfectly (i dont fully understand it tho).
                                        It still works perfectly, only, the server where i'm putting this on, needs PHP support, Which is installed now, but something is still wrong, as the PHP will not respond back to the swf, nor will it send the email.

                                        I tried php.net for help, since thats where I got PHP from in the first place....but those people still havent gotten back to me yet....
                                        hence why I came here. I know this isn't the right place to ask, but i also know that theres some reallly smart people in here, who might be able to shed some light on this problem i'm having.
                                        • 17. Re: To ALL the REALLLLLY smart people.
                                          scrfix Level 1
                                          PHP and ASP forms require an email handler which this script does not have. Whether you are using CDONTS or some other type of DLL file installed onto the server in order to send your email. There is nothing like that in this form. There is nothing stating what handler it is going to use.

                                          Let's break down your code for a second


                                          This whole AS2 script takes the information from the form and sends it to a PHP script that should be named: planitVenusContact.php


                                          //************** AS 2.0 ****************\\


                                          dataSender = new LoadVars();
                                          dataReciever = new LoadVars();

                                          submit_mc.onRelease = function() {
                                          if(name_txt.text != "" &&
                                          email_txt.text != "" &&
                                          number_txt.text !="" &&
                                          message_txt.text !="" ) {
                                          alert_txt.text="";
                                          _root.play();

                                          dataSender.name = name_txt.text;
                                          dataSender.email = email_txt.text;
                                          dataSender.number = number_txt.text;
                                          dataSender.fax = fax_txt.text;
                                          dataSender.mobile = mobile_txt.text;
                                          dataSender.message = message_txt.text;

                                          dataReciever.onLoad = function() {
                                          if(this.response == "invalid") {
                                          _root.gotoAndStop(1);
                                          alert_txt.text = "Please Check Email Address"
                                          }else if (this.response == "error") {
                                          _root.gotoAndStop(3);
                                          }else if (this.response == "passed") {
                                          _root.gotoAndStop(4);
                                          }
                                          //trace(this.response.length);
                                          }
                                          dataSender.sendAndLoad("planitVenusContact.php", dataReciever, "POST");
                                          } else {
                                          alert_txt.text = "Please complete all fields before submitting form.";
                                          }
                                          }








                                          Okay I spotted where the handler is. You are using the mail() function for a mail handler. In order for this to work properly, you have to have the sendmail program on your server as well. If you do not have sendmail installed onto the computer and you are using something else other than sendmail than you have to have a wrapper.

                                          You can refer to the documentation on php.net for the answers on that.
                                          http://www.php.net/manual/en/ref.mail.php

                                          Your simplest solution is to ensure that you have the sendmail program installed onto your server.





                                          //************** PHP ***************\\


                                          <?php
                                          $subject= 'Comments from Website';
                                          $from= 'www.website.com';
                                          $name=$_POST['name'];
                                          $email=$_POST['email'];
                                          $number=$_POST['number'];
                                          $fax=$_POST['fax'];
                                          $mobile=$_POST['mobile'];
                                          $message=$_POST['message'];

                                          $name=trim($name);
                                          $email=trim($email);
                                          $number=trim($number);
                                          $subject=stripslashes($subject);
                                          $message=stripslashes($message);

                                          $toaddress="seul_kof@yahoo.com";

                                          $EmailBody ="Name: $name\n Phone Number: $number\n Fax Number: $fax\n Mobile Number: $mobile\n\n Enquiry: $message";

                                          if(mail($toaddress,$subject,$EmailBody,"From: ".$name." <".$email.">")){
                                          $name='';
                                          $email='';
                                          $number='';
                                          $subject='';
                                          $message='';
                                          $EmailBody='';
                                          echo "&response=passed";
                                          } else {
                                          echo "&response=failed";
                                          }
                                          ?>

                                          • 18. To ALL the REALLLLLY smart people.
                                            Sketchsta Level 1
                                            to whoever tested the contact form.. here it is..

                                            ****************************************************************************************** *
                                            To: seul_kof@yahoo.com
                                            Subject: Comments/Bookings
                                            From: "test" <only@> Add to Address BookAdd to Address Book Add Mobile Alert ,
                                            Date: Fri, 26 Oct 2007 13:25:20 +0800

                                            Name: test
                                            Phone Number: test again
                                            Fax Number: only a test
                                            Mobile Number: this is a test only

                                            Enquiry: Testing this
                                            ***************************************************************************************** *

                                            this one works, (on my server) but when i place it on the actual server where the site is going, the form doesnt send.. thats where the problem is..
                                            any ideas?
                                            • 19. Re: To ALL the REALLLLLY smart people.
                                              clbeech Level 3
                                              still got nothin' on the php problem, but I think SS has the right idea there with the 'sendmail' php configuration being needed, I think it's listed in my servers phpinfo.

                                              but to the XML problem, sounds like you need to add a 'crossdomain policy file' to the root directory of either system, to allow XML accessing.
                                              • 20. To ALL the REALLLLLY smart people.
                                                Sketchsta Level 1
                                                Ohh, that XML story i told, was just an example. I was basically saying that the servers at work wont allow swf files to get or send info to outside servers.
                                                This was my boss's doing.
                                                Sometimes i honestly think he doesnt know half the things he says he knows..

                                                By the way, I havent read about this yet. But in the embed code that Flash generates, I remember seeing something about "SameDomainAccess" or something along those lines... what's all that about?
                                                could that be a factor for this PHP problems im having?

                                                i'll get the exact code and place it in the next post.
                                                • 21. Re: To ALL the REALLLLLY smart people.
                                                  clbeech Level 3
                                                  well, it might be possible that this is a Security Sandbox issue, but I had thought this was only to allow scripting access to swf files specficly. Are you saying then that the SWF is not within the same domain as the PHP script? It would explain not getting a return post from the script but it should still fire it, I think ...

                                                  try commenting out the 'mailing' code, and put a generic echo to print something to the browser when fired. Run the SWF and see if you can get an output fromtthe PHP in the other domain. If that works, at least you know your getting a connection to the script, if not ...

                                                  But for a return to be written from outside the domain you may want to put a line in your AS code to allow this, preceeding the LV sending script add:

                                                  System.security.allowDomain('*');

                                                  the 'wildcard' is a test, you could be specific as to the domain. This may let the php write to the returnLV, so that at least you'll know if there has been a connetion made, for starters.

                                                  Also you may want to try taking the 'mail()' method out of the 'if' statement, just to test it on it's own, although this is working from your server, I'm not certain that this syntax is proper, and it may be interferring somehow (dunno).
                                                  • 22. Re: To ALL the REALLLLLY smart people.
                                                    scrfix Level 1
                                                    I had no idea you were attempting to do this between domains. Yeah. You will definitely need the system.security.allDomain('myDomainGoesHere'); to allow access otherwise you will not have access. It is a security problem.

                                                    As I understood it, you had just installed PHP onto the new server along with your flash. This would put them both on the same server. If they are on the same server, you will not need that. However if you are attempting to jump servers, you will need that.

                                                    Wayne
                                                    • 23. Re: To ALL the REALLLLLY smart people.
                                                      Sketchsta Level 1
                                                      Sorry guys, abit of a mix up here in stories..

                                                      first. The PHP problem I'm having, is all on the one server (the work server). Both swf and php file are on the same server, it just wount send emails.

                                                      ** the whole cross domain thing **
                                                      Before the work servers had PHP support installed, I was doing my contact forms as follows:
                                                      work server = Whole site, html, swf.
                                                      my server = php contact file.
                                                      this woked great, all contact forms were working, sending emails. But my boss changed something on his servers, and as a result, the swf files (the contact form) were not allowed to communicate with the php file on my server.

                                                      This is around the time I made my boss install PHP support, which leads us to where I am now.... begging for help. =(

                                                      Hope this clears things up abit. sorry for the confusion. =)
                                                      • 24. Re: To ALL the REALLLLLY smart people.
                                                        scrfix Level 1
                                                        First, we have pinpointed this down to your sendmail. This is why you cannot send. Your PHP is written properly. Your sendmail is the problem.

                                                        In the interest of not repeating exactly what was written check out this and make sure you have sendmail variables checked properly. Also he adds something to the sendmail.cf file. That may work for you as well.

                                                        http://www.thescripts.com/forum/thread4035.html

                                                        Wayne
                                                        • 25. To ALL the REALLLLLY smart people.
                                                          Sketchsta Level 1
                                                          Hi guys, Im sorry for not posting back in the past few weeks, another job came up and I wanted to get that out of the way before coming back to this problem.
                                                          I hope you guys dont think I was ungrateful.

                                                          The problem with sending emails from my contact form is still not working. The last thing i did was what Spectacular Stuff suggested.

                                                          //************************************* Spectacular Stuff ****************************************\\

                                                          Okay I spotted where the handler is. You are using the mail() function for a mail handler. In order for this to work properly, you have to have the sendmail program on your server as well. If you do not have sendmail installed onto the computer and you are using something else other than sendmail than you have to have a wrapper.

                                                          You can refer to the documentation on php.net for the answers on that.
                                                          http://www.php.net/manual/en/ref.mail.php

                                                          Your simplest solution is to ensure that you have the sendmail program installed onto your server.

                                                          \\______________________________________________________________________//

                                                          This must be where the problem is. because once i installed that sendmail patch my Flash Form actually got a response from the PHP script.
                                                          unfortunately, it's still not sending the data to an email.

                                                          I read through that document on www.php.net and i told my boss exactly what to do, and how to do it....I even gave him the link to that site.
                                                          But something must still be wrong.

                                                          I dont know nearly enough about servers, and php, to work this out.
                                                          the only things i do know, is how to make the contact form, and the php to go with it... I still need your help guys.