DarkLogan Posted February 2, 2009 Share Posted February 2, 2009 I built a website in flash. I added a place where ppl can type a msg and click send and it would send that msg to my email simple enough right. Well then I learned that its a php script/file that i need to make it work. Now knowing nothing what so ever about php this is what I have. <?php $name = $_POST['Name']; $email = $_POST['Email']; $message = $_POST['Message']; $name = stripslashes($name); $email = stripslashes($email); $message = stripslashes($message); $rec_email = "[email protected]"; $subject = "Website Visitor"; $msg_body .= "Name: $name\n\n"; $msg_body .= "E-Mail: $email\n\n"; $msg_body .= "Comments: $message\n\n"; mail($rec_email, $subject, $msg_body); ?> Well after I uploaded it and all the files that go with it it didnt work. I was told that I need to change the file attributes to 755. Well I tried that using cuteftp pro and there is no such option. Sooooo I called my host and basically said wtf and they said they dont support 3rd party scripts that i would have to use one of theirs. Well here it is <form action="gdform.php" method="post"> <input type="hidden" name="subject" value="Form Submission" /> <input type="hidden" name="redirect" value="thankyou.html" /> <p>First Name:<input type="text" name="FirstName" /></p> <p>Last Name:<input type="text" name="LastName" /></p> <p>E-Mail:<input type="text" name="email" /></p> <p>Comments:<textarea name="comments" cols="40" rows="10"> Type comments here.</textarea></p> <input type="submit" name="submit" value="submit"/> </form> Now I have no clue how to change this or make it work in my flash movie because im no good with php. My host seems to think that the newbies can just take a code and make it work. I think they should change the attributes on the one that i know will work. Anyway if someone has been down this road with their host or can somehow work my php code into their php code i would greatly appreciate it. I say my code just for difference in this post. But no i didnt write it dont know who did and couldnt find them if i wanted too. The code came from a book that matches the form in my flash layout. Guys thanx for any help in this matter. Link to comment https://forums.phpfreaks.com/topic/143525-mail-form-issue/ Share on other sites More sharing options...
justinh Posted February 2, 2009 Share Posted February 2, 2009 this page <form action="gdform.php" method="post"> <input type="hidden" name="subject" value="Form Submission" /> <input type="hidden" name="redirect" value="thankyou.html" /> <p>First Name:<input type="text" name="FirstName" /></p> <p>Last Name:<input type="text" name="LastName" /></p> <p>E-Mail:<input type="text" name="email" /></p> <p>Comments:<textarea name="comments" cols="40" rows="10"> Type comments here.</textarea></p> <input type="submit" name="submit" value="submit"/> </form> When submitted, will load gdform.php gdform.php needs to look something like <?php $subject = $_POST['subject']; $redirect = $_POST['redirect']; $sendto = "[email protected]"; // you will need to change this line to your email $name = $_POST['FirstName'] . $_POST['LastName']; $email = $_POST['email']; $mail_body = "Message from " . $email . ": \n " . $_POST['comments']; mail($sendto, $subject, $mail_body); ?> Link to comment https://forums.phpfreaks.com/topic/143525-mail-form-issue/#findComment-752920 Share on other sites More sharing options...
DarkLogan Posted February 2, 2009 Author Share Posted February 2, 2009 I tried the code just as posted and it did not work. How am I suppose to save this as email.php or gdform.php Because if i have to save it as gdform.php then i need to change what the flash looks for. So confused ??? Link to comment https://forums.phpfreaks.com/topic/143525-mail-form-issue/#findComment-752942 Share on other sites More sharing options...
justinh Posted February 2, 2009 Share Posted February 2, 2009 Not really sure about Flash and PHP.. but I did a quick google search and this might help you: http://www.kirupa.com/developer/actionscript/flash_php_mysql.htm Link to comment https://forums.phpfreaks.com/topic/143525-mail-form-issue/#findComment-752955 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.