Papalex606 Posted May 13, 2007 Share Posted May 13, 2007 Hi guys, ive currently finished editing a flash template and im stuck on a part i assumed would be easy...the contact form. Im sooo desperate to get this contact form on my flash website and i just cant figure out what i have to do nxt to get it working. Ive been on hundreds of websites to try and figure it out, and cant still cant understand why i keep getting errors, a few suggested it may have some thing to do with a smtp? Im a newbie at this so, really have no idea what that means or how to do it. I was using a default script from http://info.template-help.com/after_sale_support/Working_with_Flash/Advanced/article7.html because i dont know how to make one myself. Ive followed the instructions exactly but im still getting anhialated by error messages when i test it online. Id appreciate any help you could give me! Im even willing to pay for the help. This really is the last thing standing in the way of me putting the site online. Im not sure what information you might need to help me out so i'll include everything i can. - In flash mx on the 'reset' button contains the following actionscript: - on(rollOver){ this.gotoAndPlay("s1"); } on(rollOut, releaseOutside){ this.gotoAndPlay("s2"); } on(release) { //_parent.t1_2="; _parent.company="Your Company:"; _parent.name="Your Name:"; _parent.phone="Your Phone:"; _parent.email="Your Email:"; _parent.message="Your Message:"; } - The 'submit' button contaisn the following actionscript: - on(rollOver){ this.gotoAndPlay("s1"); } on(rollOut, releaseOutside){ this.gotoAndPlay("s2"); } on(rollOver){ this.gotoAndPlay("s1"); } on(rollOut, releaseOutside){ this.gotoAndPlay("s2"); } on(release) { //_parent.t1_2=""; _parent.getURL("contact.php","_blank","get"); _parent.company="Your Company:"; _parent.name="Your Name:"; _parent.phone="Your Phone:"; _parent.email="Your Email:"; _parent.message="Your Message:"; } - Finally, the code im using for the contact.php is below, is there something missing thats preventing it from working? <?php $your_company = $_GET['company]; $your_name = $_GET['name']; $your_phone = $_GET['phone']; $your_email = $_GET['email']; $your_message = $_GET['message']; $recipient_email = "info@darkiconstudios.com"; $subject = "from " . $your email; $headers = "From: " . $your_name . " <" . $your_email . ">\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1'; $content = "<html><head><title>Contact letter</title></head><body><br>"; $content .= "Company: <b>" . $your_company . "</b><br>"; $content .= "Name: <b>" . $your_name . "</b><br>"; $content .= "Phone: <b>" . $your_phone . "</b><br>"; $content .= "E-mail: <b>" . $your_email . "</b><br><hr><br>"; $content .= $your_message; $content .= "<br></body></html>"; mail($recipient,$subject,$content,$headers); ?> <html> <body bgcolor="#282E2C"> <div align="center" style="margin-top:60px;color:#FFFFFF;font-size:11px;font-family:Tahoma;font-weight:bold"> Your message was sent. Thank you. </div> </body> </html> <script>resizeTo(300, 300)</script> The errors that occur when i click submit is - Parse error: parse error, unexpected T_STRING in e:\domains\p\pavelockstudios.com\user\htdocs\contact.php on line 11 Thanks alot for taking the time to read it, i know its probably a pain for you to recieve newbie things like this but you guys seem like the right people to speak to. If someone could tlel me where im goin wrong (in simple terms) and how to put it right and get the contact form running, id be forever grateful. Many, many thanxs. Alex. :D:D Quote Link to comment https://forums.phpfreaks.com/topic/51178-i-need-help-with-a-contact-form-soo-bad-there-must-be-a-saviour-in-my-time-of-n/ Share on other sites More sharing options...
esukf Posted May 13, 2007 Share Posted May 13, 2007 <?php $subject = "from " . $your_email; //missing underscore ?> Quote Link to comment https://forums.phpfreaks.com/topic/51178-i-need-help-with-a-contact-form-soo-bad-there-must-be-a-saviour-in-my-time-of-n/#findComment-251968 Share on other sites More sharing options...
Papalex606 Posted May 13, 2007 Author Share Posted May 13, 2007 Thankyou soo much for the fastest reply ever! I put the underscore in there so it read: - $recipient_email = "info@darkiconstudios.com"; $subject = "from " . $your_email; $headers = "From: " . $your_name . " <" . $your_email . ">\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1'; However instead of the previous error it now reads: - Notice: Undefined variable: recipient in e:\domains\p\pavelockstudios.com\user\htdocs\contact.php on line 23 Warning: mail() [function.mail]: SMTP server response: 554 Error: no valid recipients in e:\domains\p\pavelockstudios.com\user\htdocs\contact.php on line 23 Your message was sent. Thank you. What do you recon esukf? Any ideas? Thanks again. Quote Link to comment https://forums.phpfreaks.com/topic/51178-i-need-help-with-a-contact-form-soo-bad-there-must-be-a-saviour-in-my-time-of-n/#findComment-251975 Share on other sites More sharing options...
Papalex606 Posted May 13, 2007 Author Share Posted May 13, 2007 can anyone help? The code in the first post still applies (with corrections from the last post) Am i using the wrong code to get this contact form working? is there something missing from it that stops it from working? Appreciate all help. Many thanxs. Quote Link to comment https://forums.phpfreaks.com/topic/51178-i-need-help-with-a-contact-form-soo-bad-there-must-be-a-saviour-in-my-time-of-n/#findComment-251995 Share on other sites More sharing options...
chigley Posted May 13, 2007 Share Posted May 13, 2007 <?php /* Change: */ mail($recipient,$subject,$content,$headers); /* To: */ mail($recipient_email,$subject,$content,$headers); ?> Quote Link to comment https://forums.phpfreaks.com/topic/51178-i-need-help-with-a-contact-form-soo-bad-there-must-be-a-saviour-in-my-time-of-n/#findComment-251999 Share on other sites More sharing options...
Papalex606 Posted May 13, 2007 Author Share Posted May 13, 2007 Chigley you are the man, cant thank you enough. No errors, ive been waiting for this moment for sooo long! However, theres a new problem now: - When i upload everything to my ftp server, and click on the wbsite, everything runs smoothly. When i clear the contact form cells, they reset themselves which is great, however when i fill out the cells and click send, the message window does come up saying 'Thankyou your message was sent' (with no errors YAY ) but i recieve no message in my email account when i ckeck it afterwards. I waited 10mins to see if perpahps it had gone astray, but nothing....lol Its like the message is getting lost in the vastness of the internet. How can i check thats its even working? Many many thanxs! Quote Link to comment https://forums.phpfreaks.com/topic/51178-i-need-help-with-a-contact-form-soo-bad-there-must-be-a-saviour-in-my-time-of-n/#findComment-252016 Share on other sites More sharing options...
chigley Posted May 13, 2007 Share Posted May 13, 2007 In a separate file on the same server make a file with this in it: <?php mail("youremail@domain.com", "Test Email", "Testing..."); ?> Replace the email in it and run the file. If you don't get the email, you need to contact your host about SMTP. Chigley Quote Link to comment https://forums.phpfreaks.com/topic/51178-i-need-help-with-a-contact-form-soo-bad-there-must-be-a-saviour-in-my-time-of-n/#findComment-252020 Share on other sites More sharing options...
Papalex606 Posted May 13, 2007 Author Share Posted May 13, 2007 What should i make the file in? Do i make a new .php file with just that code it? If so what should i call it? and how should i run it to test. Sorry man, im a serious newbie to this whole thing. Thanxs soo much. Quote Link to comment https://forums.phpfreaks.com/topic/51178-i-need-help-with-a-contact-form-soo-bad-there-must-be-a-saviour-in-my-time-of-n/#findComment-252026 Share on other sites More sharing options...
chigley Posted May 13, 2007 Share Posted May 13, 2007 Yeah call it whatever you want, saved as a .php file. Then just type the URL in your browser and run the file. Then check your emails and let me know if you receive it Quote Link to comment https://forums.phpfreaks.com/topic/51178-i-need-help-with-a-contact-form-soo-bad-there-must-be-a-saviour-in-my-time-of-n/#findComment-252028 Share on other sites More sharing options...
Papalex606 Posted May 13, 2007 Author Share Posted May 13, 2007 ha ha excellent, thankyou, when you say type in the URL and run the file, does that mean just visit my site online and send an email again? lol Cos if thats the case i did it perfect! I opened a new php document, pasted the code in. Saved it as test.php, uploaded it to the server through the ftp server and then visted my site on IE. I filled out the boses, click submit and it said "thankyou your email was sent' again..but still nothing in the inbox...lol Thanks chigley Quote Link to comment https://forums.phpfreaks.com/topic/51178-i-need-help-with-a-contact-form-soo-bad-there-must-be-a-saviour-in-my-time-of-n/#findComment-252044 Share on other sites More sharing options...
chigley Posted May 13, 2007 Share Posted May 13, 2007 No. Instead of going to your site and filling the form in. Go to http://www.yoursite.com/test.php Quote Link to comment https://forums.phpfreaks.com/topic/51178-i-need-help-with-a-contact-form-soo-bad-there-must-be-a-saviour-in-my-time-of-n/#findComment-252050 Share on other sites More sharing options...
john010117 Posted May 13, 2007 Share Posted May 13, 2007 What chigley means is that.. First, make a blank file named test.php and save it. Then, put ONLY this code in the file: <?php mail("youremail@domain.com", "Test Email", "Testing..."); ?> After you've done that, go to test.php. You shouldn't get any messages at all. Check your e-mail. Quote Link to comment https://forums.phpfreaks.com/topic/51178-i-need-help-with-a-contact-form-soo-bad-there-must-be-a-saviour-in-my-time-of-n/#findComment-252056 Share on other sites More sharing options...
Papalex606 Posted May 13, 2007 Author Share Posted May 13, 2007 Ahhh yeah, im with ya, sorry. I did everything as you said, when i visted the URL it was just a white blank page. I check my inbox afterwards and there was still no knew mail. Its wierd. Quote Link to comment https://forums.phpfreaks.com/topic/51178-i-need-help-with-a-contact-form-soo-bad-there-must-be-a-saviour-in-my-time-of-n/#findComment-252063 Share on other sites More sharing options...
chigley Posted May 13, 2007 Share Posted May 13, 2007 In that case, you need to ask your host. Are you on a Windows or Linux server? Quote Link to comment https://forums.phpfreaks.com/topic/51178-i-need-help-with-a-contact-form-soo-bad-there-must-be-a-saviour-in-my-time-of-n/#findComment-252066 Share on other sites More sharing options...
Papalex606 Posted May 13, 2007 Author Share Posted May 13, 2007 oh ok, what should i be asking them? Im on streamlinenet.co.uk, it says my site is hosted on a Windows 2003 with ASP server. Quote Link to comment https://forums.phpfreaks.com/topic/51178-i-need-help-with-a-contact-form-soo-bad-there-must-be-a-saviour-in-my-time-of-n/#findComment-252068 Share on other sites More sharing options...
chigley Posted May 13, 2007 Share Posted May 13, 2007 Ask them to get you details of an SMTP server you can use for PHP sendmail functions. Quote Link to comment https://forums.phpfreaks.com/topic/51178-i-need-help-with-a-contact-form-soo-bad-there-must-be-a-saviour-in-my-time-of-n/#findComment-252069 Share on other sites More sharing options...
Papalex606 Posted May 13, 2007 Author Share Posted May 13, 2007 Im not sure if tits the same thing but on my account i have avaiable to me the following details: - my SMTP server settings, my SMTP username, and smtp port. Are any of those helpful. theres also a FAQ just beneath titled 'Sendmail functions' which is a little bit too perfect. its says: - What is the path to Sendmail? /usr/sbin/sendmail -fuser\@domainname.co.uk You need to replace -fuser\@domainname.co.uk with a valid mailbox on your account: ie -froot\@yourdomain.co.uk You must leave in the -f and make sure there is a \ before the @ Please note when sending email from a script on your website either the to or from address needs to be a valid email account that is setup, eg root@yourdomain.co.uk I have no idea what i would do with this though? I understand how to apply my email address to it so it would be: - e.g -finfo\@darkiconstudios.co.uk but what would i do with this new address? Thanxs chigley, dunno what id have done if you wernt here. lol Quote Link to comment https://forums.phpfreaks.com/topic/51178-i-need-help-with-a-contact-form-soo-bad-there-must-be-a-saviour-in-my-time-of-n/#findComment-252088 Share on other sites More sharing options...
per1os Posted May 13, 2007 Share Posted May 13, 2007 http://us2.php.net/manual/en/function.mail.php Sorry I didn't read the first page, but it shoulds like you are trying to figure out how to add the -f part. Here is the code: <?php // bool mail ( string $to, string $subject, string $message [, string $additional_headers [, string $additional_parameters]] ) mail('nobody@example.com', 'the subject', 'the message', null, '-fwebmaster@example.com'); ?> Hope that helps. Quote Link to comment https://forums.phpfreaks.com/topic/51178-i-need-help-with-a-contact-form-soo-bad-there-must-be-a-saviour-in-my-time-of-n/#findComment-252092 Share on other sites More sharing options...
Papalex606 Posted May 13, 2007 Author Share Posted May 13, 2007 Oh rite, ok, so do i just insert that into the contact.php file i made? Does it matter where it goes? Do i only need to change the '-fwebmaster@example.com'); so that it applies to mine? or are there other sections i should change aswell! so the new version would look like this? <?php // bool mail ( string $to, string $subject, string $message [, string $additional_headers [, string $additional_parameters]] ) mail('nobody@example.com', 'the subject', 'the message', null, '-finfo@darkiconstudios.com'); ?> Many thanxs Quote Link to comment https://forums.phpfreaks.com/topic/51178-i-need-help-with-a-contact-form-soo-bad-there-must-be-a-saviour-in-my-time-of-n/#findComment-252095 Share on other sites More sharing options...
per1os Posted May 13, 2007 Share Posted May 13, 2007 Change everything that is relevant, if you do not change the subject or message part than that is what the email will send. The null is the mailheaders, sometimes those help quite extensively. I suggest read the usercomments / examples found on the mail function url I posted above. Quote Link to comment https://forums.phpfreaks.com/topic/51178-i-need-help-with-a-contact-form-soo-bad-there-must-be-a-saviour-in-my-time-of-n/#findComment-252099 Share on other sites More sharing options...
Papalex606 Posted May 13, 2007 Author Share Posted May 13, 2007 God im soo confused, and its not because of you. Ive done soo much over the last 24 hours to get this working, each time its different. Im soo unsure about what id need to be editing im sure i'll make more problems for myself if i change anything. If i show you the exact code on my contact.php could you suggest which parts need to be changed a what to? The 'contact.php' code is - <?php $your_company = $_GET['company']; $your_name = $_GET['name']; $your_phone = $_GET['phone']; $your_email = $_GET['email']; $your_message = $_GET['message']; $recipient_email = "info@darkiconstudios.com"; $subject = "from " . $your_email; $headers = "From: " . $your_name . " <" . $your_email . ">\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1'; $content = "<html><head><title>Contact letter</title></head><body><br>"; $content .= "Company: <b>" . $your_company . "</b><br>"; $content .= "Name: <b>" . $your_name . "</b><br>"; $content .= "Phone: <b>" . $your_phone . "</b><br>"; $content .= "E-mail: <b>" . $your_email . "</b><br><hr><br>"; $content .= $your_message; $content .= "<br></body></html>"; mail($recipient_email,$subject,$content,$headers); ?> <html> <body bgcolor="#282E2C"> <div align="center" style="margin-top:60px;color:#FFFFFF;font-size:11px;font-family:Tahoma;font-weight:bold"> Your message was sent. Thank you. </div> </body> </html> <script>resizeTo(300, 300)</script> If you were to insert the code you gave me and adjust the variables it to the above settings how would you do that? Is there anyway you could rewrite the above with the new code and changes. Im just too scared to change anything and make more errors because of my lack of knowledge. Thanks ever soo much, Alex Quote Link to comment https://forums.phpfreaks.com/topic/51178-i-need-help-with-a-contact-form-soo-bad-there-must-be-a-saviour-in-my-time-of-n/#findComment-252107 Share on other sites More sharing options...
Papalex606 Posted May 13, 2007 Author Share Posted May 13, 2007 can anyone help? Quote Link to comment https://forums.phpfreaks.com/topic/51178-i-need-help-with-a-contact-form-soo-bad-there-must-be-a-saviour-in-my-time-of-n/#findComment-252249 Share on other sites More sharing options...
chigley Posted May 13, 2007 Share Posted May 13, 2007 <?php $your_company = $_GET['company']; $your_name = $_GET['name']; $your_phone = $_GET['phone']; $your_email = $_GET['email']; $your_message = $_GET['message']; $recipient_email = "info@pavelockstudios.com"; $subject = "from " . $your_email; $headers = "From: " . $your_name . " <" . $your_email . ">\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1'; $content = "<html><head><title>Contact letter</title></head><body> "; $content .= "Company: " . $your_company . " "; $content .= "Name: " . $your_name . " "; $content .= "Phone: " . $your_phone . " "; $content .= "E-mail: " . $your_email . " "; $content .= $your_message; $content .= " </body></html>"; mail($recipient_email,$subject,$content,$headers, "-finfo@darkiconstudios.co.uk"); ?> <html> <body bgcolor="#282E2C"> <div align="center" style="margin-top:60px;color:#FFFFFF;font-size:11px;font-family:Tahoma;font-weight:bold"> Your message was sent. Thank you. </div> </body> </html> <script>resizeTo(300, 300)</script> Try that Quote Link to comment https://forums.phpfreaks.com/topic/51178-i-need-help-with-a-contact-form-soo-bad-there-must-be-a-saviour-in-my-time-of-n/#findComment-252278 Share on other sites More sharing options...
Papalex606 Posted May 13, 2007 Author Share Posted May 13, 2007 Thanxs man, even that works perfectly, says 'message sent' but i still get no email come through. I noticed in that code the email addresses id given were both different. that was an accident. They are both meant to be info@darkiconstudios.com. What you recon? Could there be any other reasons why im recieving nothing? Quote Link to comment https://forums.phpfreaks.com/topic/51178-i-need-help-with-a-contact-form-soo-bad-there-must-be-a-saviour-in-my-time-of-n/#findComment-252295 Share on other sites More sharing options...
chigley Posted May 13, 2007 Share Posted May 13, 2007 <?php $your_company = $_GET['company']; $your_name = $_GET['name']; $your_phone = $_GET['phone']; $your_email = $_GET['email']; $your_message = $_GET['message']; $recipient_email = "info@pavelockstudios.com"; $subject = "from " . $your_email; $headers = "From: " . $your_name . " <" . $your_email . ">\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1'; $content = "<html><head><title>Contact letter</title></head><body> "; $content .= "Company: " . $your_company . " "; $content .= "Name: " . $your_name . " "; $content .= "Phone: " . $your_phone . " "; $content .= "E-mail: " . $your_email . " "; $content .= $your_message; $content .= " </body></html>"; mail($recipient_email,$subject,$content,$headers, "-finfo@darkiconstudios.com"); ?> <html> <body bgcolor="#282E2C"> <div align="center" style="margin-top:60px;color:#FFFFFF;font-size:11px;font-family:Tahoma;font-weight:bold"> Your message was sent. Thank you. </div> </body> </html> <script>resizeTo(300, 300)</script> Quote Link to comment https://forums.phpfreaks.com/topic/51178-i-need-help-with-a-contact-form-soo-bad-there-must-be-a-saviour-in-my-time-of-n/#findComment-252316 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.