Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Flash php form 1

Status
Not open for further replies.

ro6er

Programmer
Jul 1, 2003
76
Hi, I can't seem to post via my php formmail. Here's my actionscript:
Code:
name.backgroundColor = "0xFFCC00";
company.backgroundColor = "0xFFCC00";
address1.backgroundColor = "0xFFCC00";
address2.backgroundColor = "0xFFCC00";
postalcode.backgroundColor = "0xFFCC00";
email.backgroundColor = "0xFFCC00";
tel.backgroundColor = "0xFFCC00";
mob.backgroundColor = "0xFFCC00";
requirements.backgroundColor = "0xFFCC00";
stop();
submit.onRelease = function() {
		mob = mob.text;
		fullname = fullname.text
		company = company.text
		address1 = address1.text
		postalcode = postalcode.text
		email = email.text
		tel = tel.text
		mob = mob.text
		requirements = requirements.text
		GeneralConstruction = GeneralConstruction.text
		ElectricalContractor = ElectricalContractor.text
		FireSafetyContractor = FireSafetyContractor.text
		HealthSafetyConsultant = HealthSafetyConsultant.text
		HealthSafetyDistributor = HealthSafetyDistributor.text
		ElectricalDistributor = ElectricalDistributor.text
		FireSafetyEquipmentWholesaler = FireSafetyEquipmentWholesaler.text
		FireSafetyConsultant = FireSafetyConsultant.text
		loadVariablesNum("text.asp", 0, "POST");

		//	loadVariablesNum("email.php", 0, "POST");
		gotoAndStop(2);
//trace("requirements");

}

Here's my php (not great with php sorry if this is something obvious) I'm only passing the requirements var just to get one working and then the rest:
Code:
<?php
/***************************************************\
 * PHP 4.1.0+ version of email script. For more
 * information on the mail() function for PHP, see
 * [URL unfurl="true"]http://www.php.net/manual/en/function.mail.php[/URL]
\***************************************************/


// First, set up some variables to serve you in
// getting an email.  This includes the email this is
// sent to (yours) and what the subject of this email
// should be.  It's a good idea to choose your own
// subject instead of allowing the user to.  This will
// help prevent spam filters from snatching this email
// out from under your nose when something unusual is put.

$sendTo = "ro6er@hotmail.com";
$subject = "Message received from the Howler website";

// variables are sent to this PHP page through
// the POST method.  $_POST is a global associative array
// of variables passed through this method.  From that, we
// can get the values sent to this page from Flash and
// assign them to appropriate variables which can be used
// in the PHP mail() function.


// header information not including sendTo and Subject
// these all go in one variable.  First, include From:
$headers = "From: " . $_POST['firstName'] ."<" . $_POST['email'] .">\r\n";
// next include a replyto
$headers .= "Reply-To: " . $_POST['email'] . "\r\n";
// often email servers won't allow emails to be sent to
// domains other than their own.  The return path here will
// often lift that restriction so, for instance, you could send
// email to a hotmail account. (hosting provider settings may vary)
// technically bounced email is supposed to go to the return-path email
$headers .= "Return-path: " . $_POST['email'];

// now we can add the content of the message to a body variable
$message = "Requirements:" . $_POST['requirements'] . "";
//$message = "Message details: " . $_POST['fullname']; ." " . $_POST['company']; ." " . $_POST['address1']; ." " . $_POST['postalcode']; ." " . $_POST['email']; ." " . $_POST['tel']; ." " . $_POST['mob']; ." " . $_POST['requirements']; ." " . $_POST['GeneralConstruction']; ." " . $_POST['ElectricalContractor']; ." " . $_POST['FireSafetyContractor']; ." " . $_POST['HealthSafetyConsultant']; ." " . $_POST['HealthSafetyDistributor']; ." " . $_POST['ElectricalDistributor']; ." " . $_POST['FireSafetyEquipmentWholesaler']; ." " . $_POST['FireSafetyConsultant'] ."\r\n";


// once the variables have been defined, they can be included
// in the mail function call which will send you an email
mail($sendTo, $subject, $message, $headers);

?>
 
Thanks I need something with radio buttons. I had some issues getting components to work. Text input fields are easy enough. I'll check it out any way. And see if I can get it to do what I want.
 
Cool thanks, i'll give that a try in a bit.

Roger
 
Ah how about checkbox's? It seems to use the groupname var in the flash. So when I add them they don't seem to work. I might see if I can remove the groupname var part in the actionscript somehow.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top