Hi, I've set up a form in flash which will send data to a PHP file on my web space, which in return will return the data from the textfields to my e-mail address. I know PHP is enabled in enabled on my web server because I tested it and it's OK.
Please can anyone check my PHP script below to see if I am missing something that would cause my e-mails not to be returned (I'm new to PHP).
I posted last week and I had to many parameters but I have now got them down to three so I hope that is OK so I am purely looking for the users input to be returned.
The PHP script is below (I've put the Actionscript code as well in-case someone notices something there)
I have tested this in an HTML page on my web server but no response from my form is received.
Thanks in advance. PHP... -
<?php
-
$to = 'me@myemailaddress.co.uk';
-
$subject = 'Request';
-
-
$message = '';
-
$message .= "\n";
-
$message .= "Name: $fullName";
-
$message .= "\n\n";
-
$message .= "Address: $fullAddress";
-
$message .= "\n\n";
-
$message .= "Postcode: $postcode";
-
$message .= "\n\n";
-
$message .= "Tel: $telNumber";
-
$message .= "\n\n";
-
$message .= "E-mail: $emailAddress";
-
-
$sent = mail ($to, $subject, $message);
-
?>
-
Actionscript... -
stop();
-
var fullName:TextField;
-
var fullAddress:TextField;
-
var postcode:TextField;
-
var telNumber:TextField;
-
var emailAddress:TextField;
-
-
fullName.restrict = "A-Za-zÁáÉéêíÍãõç ";
-
fullName.maxChars = 40;
-
-
fullAddress.restrict = "0-9A-Za-zÁáÉéêíÍãõç!?.+\- ";
-
fullAddress.maxChars = 90;
-
-
postcode.restrict = "0-9A-Za-zÁáÉéêíÍãõç!?.+\- ";
-
postcode.maxChars = 10;
-
-
telNumber.restrict = "0-9A-Za-zÁáÉéêíÍãõç!?.+\- ";
-
telNumber.maxChars = 20;
-
-
emailAddress.restrict = "0-9A-Za-zÁáÉéêíÍãõç!?.+\- ";
-
emailAddress.maxChars = 50;
-
-
function sendEmail(fullName, fullAddress, postcode, telNumber, emailAddress)
-
{
-
var myData:LoadVars = new LoadVars();
-
-
myData.fullName = fullName.text;
-
myData.fullAddress = fullAddress.text;
-
myData.postcode = postcode.text;
-
myData.telNumber = telNumber.text;
-
myData.emailAddress = emailAddress.text;
-
}
-
-
this.submitButton.onRelease = function()
-
{
-
if (fullName.text == "" || fullAddress.text == "" || postcode.text == "" || telNumber.text == "")
-
{
-
gotoAndStop("error");
-
}
-
-
else
-
-
{
-
sendEmail();
-
gotoAndStop("correct");
-
}
-
-
myData.sendAndLoad("iopost.php", myData, "POST");
-
};
-
3 1371 Atli 5,058
Recognized Expert Expert
Hi.
To use variables sent via the POST protocol in your PHP scripts, use the $_POST super-global.
Try something like: -
$message = '';
-
$message .= "\n";
-
$message .= "Name: {$_POST['fullName']}";
-
$message .= "\n\n";
-
$message .= "Address: {$_POST['fullAddress']}";
-
# Etc...
-
Hi, thanks for the reply.
It looks as if my PHP script seems to be working now, thanks for the tip (although I could be wrong being new to PHP), but now when I point to the script in a browser window I get an e-mail sent to me but only the headings are there.
Name:
Address:
etc...
The information from the textfields in the SWF file are not being captured.
I think I may have to post in the flash section but thanks for your help, and the speedy reply.
I you feel this may still be a PHP problem please post any thoughts if you can and I'll keep a lookout for any info (I've put my latest script below just in-case). -
<?php
-
$to = 'me@myaddress.co.uk';
-
$subject = 'Request';
-
-
$message = '';
-
$message .= "\n";
-
$message .= "Name: {$_POST['fullName']}";
-
$message .= "\n\n";
-
$message .= "Address: {$_POST['fullAddress']}";
-
$message .= "\n\n";
-
$message .= "Postcode: {$_POST['postcode']}";
-
$message .= "\n\n";
-
$message .= "Tel: {$_POST['telNumber']}";
-
$message .= "\n\n";
-
$message .= "E-mail: {$_POST['emailAddress']}";
-
$sent = mail ($to, $subject, $message);
-
?>
-
Thanks.
Atli 5,058
Recognized Expert Expert
Hi again.
It's been a while since I've used Flash so I may be wrong here but...
You have an object, 'myData' defined inside a function 'sendEmail'. But you are using the object outside the scope of the 'sendEmail' function. I would have to guess that is the problem.
Try calling the 'sendAndLoad' method on the object inside the 'sendEmail' function.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: David M Loraine |
last post by:
I am a sql novice and would appreciate any help with the following problem.
In a table I have property addresses stored in 6 fields. Field6 always hold
the Post Code. However, fields 4 and 5 are sometime NULL. Using the
desktop integration package we have which interfaces with MS Word when
printing an address in a letter the end results often end up looking like
this.
1 Any Street
AnyTown
|
by: james |
last post by:
CAn Some one please help when this scrip runs it does not enter the data
from my forms, it just says where each feild should be. I have
tested it using google address and it appears to work just fine. But i
cma't get it to work with the below link.
Thanks james
<script>
function doURL() {
ncheckInDate=document.getElementById("checkInDate").value
ncheckInMonth=document.getElementById("month").value
|
by: Nimit |
last post by:
Hi, I wasn't sure which forum this post belongs to, so I've posted it
to a couple forums that I thought may be appropriate.
In giving me advice, please consider me a beginner. Below is a synopsis
of my problem/question:
SOME BACKGROUND:
- I am writing a php based web application.
- There is a very data intensive task I need to do that requires
reading and lookup of a lot of data.
|
by: John Constant |
last post by:
Using the MS C++ Example
http://support.microsoft.com/default.aspx?scid=kb;en-us;261003 I've
successfully managed to trap and log Script Errors that are generated by the
WebBrowser (IE 6) which is hosted by a C# application, see below. However
I've completely failed to force the browser to continue processing script
which *should* be controlled by returning a true VT_BOOL via pvaOut. I've
tried returning bool, System.Boolean even...
|
by: Stacey Levine |
last post by:
I have a webservice that I wanted to return an ArrayList..Well the service
compiles and runs when I have the output defined as ArrayList, but the WSDL
defines the output as an Object so I was having a problem in the calling
program. I searched online and found suggestions that I return an Array
instead so I modified my code (below) to return an Array instead of an
ArrayList. Now I get the message when I try to run just my webservice...
| |
by: C.Joseph Drayton |
last post by:
I have a problem that I am hoping someone can help me with.
First let me describe the problem. I have an HTML form that in one
field has an onBlur call to a JavaScript function. When you exit the
field, it calls the JavaScript routine, which in turn calls a PHP
script. The PHP script runs returns the value needed. And returns to
the JavaScript. The JavaScript function is then supposed to set
alerts depending on the values returned from...
|
by: Dino |
last post by:
dear all,
i got this script form a customer. in general, it recieves data which is send
via http to a server and generates a .xml file from this data.
because i'm not familar with .asp, i'm totally lost transferring this script
to php. i don't understand which way the data is recieved and how it's saved.
as long this ia a very short script, i post it here. it would bne GREAT if
|
by: Alex |
last post by:
Hi,
I am a complete beginner with Oracle 9i and XML within it, not XML
alone though.
I am trying to do a regular SELECT statement using the SQL Scratchpad
within the Oracle Enterprise Manager and am trying to have it return
XML rather than the usual rows of data. Someone told me to try this:
SELECT SYS_XMLGEN (BRN_LAST_NAME)
FROM "USCMS"."BROKER_NAME"
|
by: Frank Hauptlorenz |
last post by:
Hello,
I recognized some days ago, that returning a DataTable blocks my
WCF-Service. Is this a known bug?
If I add this table to a new DataSet() and return this, it works.
Thank you,
Frank
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| | |