Hello all, I have a site I created recently and I could do
with some PHP help. My site is www.displaydesign.co.uk and on the
Contact page I need to know the script to attach to the submit
button and I also need to create a PHP file to tell the server to
email the data to me... can anyone help!!..... Please!Help with PHP
I have two samples I use in Flash seminars that might help:
http://www.hosfordusa.com/ClickSystems/courses/flash/examples/Flash2PHPMail/Flas h2PHPMailEx01.php
http://www.hosfordusa.com/ClickSystems/courses/flash/examples/Flash2PHPMail/Flas h2PHPMailEx02.php
--
Lon Hosford
www.lonhosford.com
Flash, Actionscript and Flash Media Server examples:
http://flashexamples.hosfordusa.com
May many happy bits flow your way!
''martinjamesroberts'' %26lt;webforumsuser@macromedia.com%26gt;
wrote in message
news:e6p106$j8v$1@forums.macromedia.com...
%26gt; Hello all, I have a site I created recently and I could
do with some PHP
%26gt; help.
%26gt; My site is www.displaydesign.co.uk and on the Contact
page I need to know
%26gt; the
%26gt; script to attach to the submit button and I also need to
create a PHP file
%26gt; to
%26gt; tell the server to email the data to me... can anyone
help!!..... Please!
%26gt;
Help with PHP
Thank you very much for your help on this, I managed to get
it working, the only problem I have now is that once the form has
been sent, the status text still states 'Sending....' how can I
relay the information back to conclude that the form has been sent
from my PHP app? I have simply used one text box to display all
related information, instead of a series of named frames, and this
is where I would like to see 'Message Sent!'.... Any takers? Please
help. I'm nearly there!!
The question can be answered depending on what you are using
in Flash:
LoadVars or XML. In either case there is the sendAndLoad
method. They
provide a return LoadVars or XML object that contains
information returned
from the server script in your case PHP. That information
would then tell
the Flash movie how to inform the user that the mail was sent
successfully
or has failed.
If you look at the Flash documentation for LoadVars for
example at
http://livedocs.macromedia.com/flash/8/main/00002336.html
you could consider
a simple change such as this:
if (success) {
result_ta.text = result_lv.resultsMessage;
} else {
result_ta.text = ''Error connecting to server.'';
}
On the PHP side you would as a last step
echo ''resultsMessage='' . $resultsMessage;
where in the PHP program you set $resultsMessage to represent
the correct
message.
On a more advanced level you would return tokens (codes or
ids) and let the
Flash program determine the messaging based on the token
value. This better
separates the UI from the server processing.
if (success) {
switch (result_lv.resultsId
{
case ''sent'':
result_ta.text = ''Hey the mail was sent!'';
break
case ''malformedAddress'':
result_ta.text = ''Hey your email address is not formed
correctly!'';
break
default:
result_ta.text = ''Mail not set due to unknown error,
contact technical support!'';
break
{
}
} else {
result_ta.text = ''Error connecting to server.'';
}
On the PHP side you would as a last step
echo ''resultsMessage='' . $resultsId;
and again you would have the $resultsId set in the PHP
program based on its
logic.
If you are using XML all this is the same except you need to
provide the XML
and parse out the results message or results id.
--
Lon Hosford
www.lonhosford.com
Flash, Actionscript and Flash Media Server examples:
http://flashexamples.hosfordusa.com
May many happy bits flow your way!
''martinjamesroberts'' %26lt;webforumsuser@macromedia.com%26gt;
wrote in message
news:e78cuc$h28$1@forums.macromedia.com...
%26gt; Thank you very much for your help on this, I managed to
get it working,
%26gt; the
%26gt; only problem I have now is that once the form has been
sent, the status
%26gt; text
%26gt; still states 'Sending....' how can I relay the
information back to
%26gt; conclude
%26gt; that the form has been sent from my PHP app? I have
simply used one text
%26gt; box to
%26gt; display all related information, instead of a series of
named frames, and
%26gt; this
%26gt; is where I would like to see 'Message Sent!'.... Any
takers? Please help.
%26gt; I'm
%26gt; nearly there!!
%26gt;
Hi. I'm having the same problem. I have a cool site but I
just don't understand what pieces I need for the form to work.
Could you fill me in please? I'm using Flash MX 2004. I can build
the form but I don't understand what to do next. I think I need to
put a php script on the server. Is that correct? And then I figure
I have to link the script to my form and then it will send the
email. I just need a really basic understanding of each piece and
then I can build from there. God it's frustrating to look for this
info but everywhere I go people just assume you know the basics and
they dive into the details. Can you contact me via email offline to
discuss please? I would be forever indebted. My email is
chrispopovic@mac.com.
May many happy bits flow your way!
''cpopovic'' %26lt;webforumsuser@macromedia.com%26gt; wrote in
message
news:e8cnj5$9o2$1@forums.macromedia.com...
%26gt; Hi. I'm having the same problem. I have a cool site but
I just don't
%26gt; understand
%26gt; what pieces I need for the form to work. Could you fill
me in please? I'm
%26gt; using
%26gt; Flash MX 2004. I can build the form but I don't
understand what to do
%26gt; next. I
%26gt; think I need to put a php script on the server. Is that
correct?
Yes
%26gt; And then I
%26gt; figure I have to link the script to my form and then it
will send the
%26gt; email.
You use sendAndLoad method for either the LoadVars or XML
class to send the
Flash form values to the PHP script.
%26gt;I
%26gt; just need a really basic understanding of each piece and
then I can build
%26gt; from
%26gt; there.
The example links I posted in this thread illustrate the
basics via example.
http://www.hosfordusa.com/ClickSystems/courses/flash/examples/Flash2PHPMail/Flas h2PHPMailEx01.php
http://www.hosfordusa.com/ClickSystems/courses/flash/examples/Flash2PHPMail/Flas h2PHPMailEx02.php
With a bit of searching you could find a short tutorial if
you look for
Flash MX 2004 Php Sendmail as the search values or
variations.
%26gt;God it's frustrating to look for this info but everywhere
I go people
%26gt; just assume you know the basics and they dive into the
details. Can you
%26gt; contact
%26gt; me via email offline to discuss please? I would be
forever indebted. My
%26gt; email
%26gt; is chrispopovic@mac.com.
%26gt;
You need to understand enough Actionscript and PHP to adapt
templates and
the pupose of the code lines. You need internet client server
debugging
skills and enough of an understanding to begin to hone those
skills.
--
Lon Hosford
www.lonhosford.com
Flash, Actionscript and Flash Media Server examples:
http://flashexamples.hosfordusa.com
Subscribe to:
Post Comments
(Atom)
No comments:
Post a Comment