ajay_hk Posted August 2, 2007 Share Posted August 2, 2007 Hi all, A newbie here. I wanted some advice on the PHP script I'm working on for creating a flash website. I'm working on a project of creating a flash portal for a small start up company and facing few issues with the PHP script. The webpage has a contact link on it wherein customers enter thier contact info such as name, address and thier request (this is a form). The script written has to send this request (with all the contact details) through.... I was having problems with that. A confirmation email is set up and that is working as expected, which would mean that the flash script is working. But I was not sure why the actual request is not getting through. It would be really helpful if you could please provide me some insight on where the problem might be or what do we have to refer to solve that. The script is as follows <?PHP // Please change the value of these variables to your liking. $YourWebpageAddress = "the website"; $YourSiteName = "website address"; $YourCompanyEmailAddress = "me@mycompany.com"; $to = "me@yahoo.com"; //=========================================================== // You can also change the value of these variables, but it is optional! $subject = "You have a request."; $headers = "From: My Website"; $forward = ""; $location = ""; //=========================================================== // Please don't change these lines ========================== $date = date ("l, F jS, Y"); $time = date ("h:i A"); $msg = "Below is the result of your request form. ------------------------------------------------ Full Name: $FullName Email Address: $EmailAddress Company: $Company Address: $Address City: $City State: $State Zip Code: $ZipCode Phone Number: $PhoneNumber Extension: $Ext Request: $Request ------------------------------------------------- It was submitted on $date at $time. Using: $HTTP_USER_AGENT IP address: $REMOTE_ADDR \n\n"; mail($to, $subject, $msg, $headers); //Sending Confirmation Email to the user--------------------------------------------------------------------------------------; $ConfirmationEmailMsg = " Hi $FullName, Thank you for contacting $YourSiteName. We will contact you as soon as your request gets reviewed. If you have any question regarding your request, please feel free to contact us at 1-030-333-0000. Sincerely, ----------------------------------------------------------- $YourSiteName . $YourWebpageAddress ----------------------------------------------------------- "; $ConfirmationEmailSubject = "Thanks For Contacting $YourSiteName."; mail($EmailAddress, $ConfirmationEmailSubject, $ConfirmationEmailMsg, "From: $YourCompanyEmailAddress"); print "_root.contact.PHPStatus=Your request has been successfuly sent. You Will recieve a confirmation e-mail shortly.\n Thank you. \n $YourSiteName ."; ?> I'm a novice at PHP, actionscripting and flash. Before asking for help, I went through the forums to see if i could find something, but was not able to - due to time constraints, it would be really helpful if you could please take a look at the script and advice. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/63120-a-novice-requestin-for-help-php-scripting/ Share on other sites More sharing options...
btherl Posted August 3, 2007 Share Posted August 3, 2007 The two most likely problem I can think of are 1. The arguments you gave to mail() are not valid. This can be tough to track down. You can try simplifying the arguments until it starts working. Or 2. Your email provider is blocking the email for some reason. Edit: Your email provider may simply have delayed the email, due to suspicion of spam. If this is the case, you'll get the emails but only much later. Quote Link to comment https://forums.phpfreaks.com/topic/63120-a-novice-requestin-for-help-php-scripting/#findComment-314599 Share on other sites More sharing options...
bibby Posted August 3, 2007 Share Posted August 3, 2007 I noticed that the script is assuming that register globals. First test the mail function itself. Just after the first mail call , add a line explicitly testing that fxn. mail('you@yourdomain.com','Subject Test','Body Test','From: foo@test.org'); if that works. mail() is fine. Now test the variables echo "<h1>$EmailAddress ?</h1>"; $EmailAddress was supposed to come from the form. Did it make it? If so, you'd see it nice and big. The reason for the question mark is to see something in case $EmailAddress is empty. Next, try, echo "<h1>".$_POST['EmailAddress']." ?</h1>"; Did that make a difference? If register globals is off, you'll have to use $_POST , $_GET, or $_REQUEST. (REQUEST == $_GET & $_POST) To test for those var_dump($_POST); var_dump($_GET); Use what you find. If these are null or flase, it's your form's fault. Quote Link to comment https://forums.phpfreaks.com/topic/63120-a-novice-requestin-for-help-php-scripting/#findComment-314671 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.