Page 1 of 1

a simple question for some..

Posted: Sun Jan 09, 2011 3:22 am
by jax_s
Hi, I'm trying to set up a flash form. Can get the mail to myself and sender ok but for the life of me can not get both subject lines working at the same time. I'm not a PHP person, know a little - hence me getting so far, figure a day on this is enough. Would love a hand if possable,
Best.


The flash part is directly below, the php page is below, following

__________________

Code: Select all

on (release) {
    if(your_name=="") {
        result="Please Enter Your Name";
        error_sound.gotoAndPlay(2)
    }
    else if (!e_mail.length || e_mail.indexOf("@") == -1 || e_mail.indexOf(".") == -1) {
        result = "Please Enter a Valid Email Address";
        error_sound.gotoAndPlay(2)
    }
    else if ( comments=="") {
        result="Please Enter a Message";
        error_sound.gotoAndPlay(2)
    }
    else {
        /////////////////////////////////////////////////////////////////////////////////////////////
        //  SETTINGS MADE HERE
        //This is YOUR e-mail address that their mail is sent to.
        my_email=  "email address goes here";
        //This is the subject of the mail you receive, and appends the senders IP.
        my_subject=  "website";
        //This is the Name on the Thank You e-mail they receive back.
        mail_name=  "name";
        //This is the subject on the Thank You e-mail. (Adds their name for a personal touch)
        reply_subject=  "Thanks for your Message" add your_name;
        //This is the Message content on the Thank You e-mail.(Adds their name for a personal touch)
        thanks_text=  "Thank you" add ". Your E-Mail has been received, and will be replied to as soon as possible";
        // END OF SETTINGS
        ////////////////////////////////////////////////////////////////////////////////////
        email=e_mail;
        name=your_name;
        message=comments;
        loadVariablesNum("mailform.php",0,'POST');
        reply_subject="";
        your_name="";
        e_mail="";
        comments="";
        result="Sending Message";
        gotoAndPlay(2);
    }
}
_____________________________________________


Mailform.php is below.

Code: Select all

<?php
$ip_address = $REMOTE_ADDR;
print "";

$reply_subject = $HTTP_POST_VARS['reply_subject'];
$message = $HTTP_POST_VARS['message'];
$name = $HTTP_POST_VARS['name'];
$email = $HTTP_POST_VARS['email'];
$my_email = $HTTP_POST_VARS['my_email'];
$thanks_text = $HTTP_POST_VARS['thanks_text'];
$mail_name = $HTTP_POST_VARS['mail_name'];

if ($email != ""){
$header_info = "MIME-Version: 1.0\r\n"; 
$header_info .= "Content-type: text/html; charset=iso-8859-1\r\n"; 
$header_info .= "From: ".$mail_name." <".$my_email.">"; 

mail ($email,$reply_subject,$thanks_text,$header_info); 

$header_info = "MIME-Version: 1.0\r\n"; 
$header_info .= "Content-type: text/html; charset=iso-8859-1\r\n"; 
$header_info .= "From: ".$name." <".$email.">"; 

$message = stripslashes($message);

mail ($my_email, $my_subject, 
"Name: 
$name
<br>
Email Address: 
$email
<br>
<br>
Message:
<br>
$message"
, $header_info); 
}

?>

Re: a simple question for some..

Posted: Sun Jan 09, 2011 10:27 am
by social_experiment

Code: Select all

<?php
$mailMessage = "
Name: $name
<br />
Email Address : $email
<br />
<br />
Message:
<br />
$message";

//
mail ($my_email, $my_subject, $mailMessage, $header_info);
?>
$HTTP_POST_VARS have been deprecated, the ip address is $_SERVER['REMOTE_ADDR']

Hth

Re: a simple question for some..

Posted: Sun Jan 09, 2011 5:00 pm
by jax_s
thanks for that... sorted and working...

regards