Jump to content

Mail Form Issue


DarkLogan

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.