| | |
mailer.php almost works :|
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Oct 2007
Posts: 1
Reputation:
Solved Threads: 0
Hi Everyone,
Another newby here with hat in hand. I'm working on a basic flash/php mail program. Working with the template provide from a website; I want some additional fields to the formmail. So I added some text boxes to the .FLA file which sends the variables to the PHP file.
I thought it would be simple enough to do, but I'm still not getting the output I want; showing all the text fields in the email.
This is the actionscript for the .FLA file
and this is the code on the php side
and this is the email that I get
------------------------------------------------------
Sent: Tuesday, October 30, 2007 2:10 AM
To: Administrator
Subject: Contact form
10.1.10.131
comments3
--------------------------------------------------
Another newby here with hat in hand. I'm working on a basic flash/php mail program. Working with the template provide from a website; I want some additional fields to the formmail. So I added some text boxes to the .FLA file which sends the variables to the PHP file.
I thought it would be simple enough to do, but I'm still not getting the output I want; showing all the text fields in the email.
This is the actionscript for the .FLA file
actionscript Syntax (Toggle Plain Text)
stop(); name_box.tabIndex = 1; phone_box.tabIndex = 2; subject_box.tabIndex = 3; email_box.tabIndex = 4; street_box.tabIndex = 5; po_box.tabIndex = 6; city_box.tabIndex = 7; state_box.tabIndex = 8; zip_box.tabIndex = 9; ccomments_box.tabIndex = 10; send_btn.onRelease = function() { my_vars = new LoadVars(); my_vars.cname = name_box.text; my_vars.cphone = phone_box.text; my_vars.csubject = subject_box.text; my_vars.csender = email_box.text; my_vars.cstreet = street_box.text; my_vars.cpo = po_box.text; my_vars.ccity = city_box.text; my_vars.cstate = state_box.text; my_vars.czip = zip_box.text; my_vars.ccomments = ccomments_box.text; if (my_vars.csender != "" and my_vars.csubject != "" and my_vars.ccomments != ""and my_vars.cstate != "" and my_vars.czip != "") { my_vars.sendAndLoad("mailer.php", my_vars, "POST"); gotoAndStop("success"); } else { error_clip.gotoAndPlay("success"); } my_vars.onLoad = function() { gotoAndStop("fail"); }; }; email_box.onSetFocus=csubject_box.onSetFocus=cmessage_box.onSetFocus=function () { if (error_clip._currentframe != 1) { error_clip.gotoAndPlay(6); } }; /*email_box.onSetFocus = subject_box.onSetFocus=message_box.onSetFocus=function () { if (error_clip._currentframe != 1) { error_clip.gotoAndPlay(6); } }; */
and this is the code on the php side
php Syntax (Toggle Plain Text)
<?php /* --------------------------- php and flash contact form. by www.MacromediaHelp.com --------------------------- Note: most servers require that one of the emails (sender or receiver) to be an email hosted by same server, so make sure your email (on last line of this file) is one hosted on same server. --------------------------- */ // read the variables form the string, (this is not needed with some servers). $csubject = $_REQUEST["subject"]; $cname = $_REQUEST["name"]; $cphone = $_REQUEST["phone"]; $cstreet = $_REQUEST["street"]; $cpo = $_REQUEST["po"]; $ccity = $_REQUEST["city"]; $cstate = $_REQUEST["state"]; $czip = $_REQUEST["zip"]; $ccomments = $_REQUEST["ccomments"]; $csender = $_REQUEST["sender"]; // include sender IP in the message. $full_message = $_SERVER['REMOTE_ADDR'] . "\n\n" . $ccomments . "\n\n" . $cname . "\n\n" . $cphone . "\n\n" . $cstreet . "\n\n" . $cpo . "\n\n" . $ccity . "\n\n" . $cstate . "\n\n" . $czip; $message= $full_message; // remove the backslashes that normally appears when entering " or ' $message = stripslashes($message); $subject = stripslashes($csubject); $sender = stripslashes($csender); // add a prefix in the subject line so that you know the email was sent by online form $subject = "Contact form ". $subject; // send the email, make sure you replace email@yourserver.com with your email address if(isset($message) and isset($subject) and isset($sender)){ mail("administrator@gnci.net", $subject, $message, "From: $sender"); } ?>
and this is the email that I get
------------------------------------------------------
Sent: Tuesday, October 30, 2007 2:10 AM
To: Administrator
Subject: Contact form
10.1.10.131
comments3
--------------------------------------------------
try placing the variables in single quotes like this:
$full_message = $_SERVER['REMOTE_ADDR'] . "\n\n" . '$ccomments '. "\n\n" . '$cname' . "\n\n" . '$cphone' . "\n\n" . '$cstreet' . "\n\n" . '$cpo' . "\n\n" . '$ccity' . "\n\n" . '$cstate' . "\n\n" .' $czip'
$full_message = $_SERVER['REMOTE_ADDR'] . "\n\n" . '$ccomments '. "\n\n" . '$cname' . "\n\n" . '$cphone' . "\n\n" . '$cstreet' . "\n\n" . '$cpo' . "\n\n" . '$ccity' . "\n\n" . '$cstate' . "\n\n" .' $czip'
I keep hitting "escape", but I'm still here!!!!
:}
:}
![]() |
Similar Threads
- Help with my first step on Php (PHP)
- Play song when page load using PHP (PHP)
- PHP Mail Error (PHP)
- php url code? (PHP)
- php in unix (Getting Started and Choosing a Distro)
- PHP Joomla (PHP)
- Question about ASp or Php (PHP)
- php mysql help (PHP)
Other Threads in the PHP Forum
- Previous Thread: Run PHP script every 10 seconds
- Next Thread: PHP problem
| Thread Tools | Search this Thread |
# 5.2.10 alexa apache api array beginner binary broken cakephp checkbox class clean clients cms code cron curl database date directory display dissertation dynamic echo echo$_get[x]changingitintovariable... email encode error fairness file files folder form forms function functions google href htaccess html image images include indentedsubcategory insert ip javascript joomla legislation limit link local login mail memberships menu mlm multiple multipletables mysql mysqlquery newsletters oop open paypal pdf persist php problem provider query radio random recursion remote rss script search server sessions simple sms sockets source space spam sql syntax system table tutorial update upload url validator variable video web youtube





