473,407 Members | 2,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Recieve Variables from Flash.

5
Hi Guys..

Not sure if this has been covered before, but I've been searching the net now for 4 days..

I have a flash form, that uses a PHP script to send me the details from that form via email. What I also want, is for that form to send the variables to be displayed on another web page..

i.e.



Any thoughts??
Mick!
Mar 31 '10 #1

✓ answered by chathura86

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. session_start(); //this will start the session
  4.  
  5. $headers = "MIME-Version: 1.0\r\n";
  6. $headers .= "Content-type: text/html; charset=windows-1251\r\n";
  7.  
  8. $email = $_POST['fromemail'];
  9. $sendto = "info@just-airports.net, $email";
  10. $subject = 'Booking from Just-Airports.net Website';
  11.  
  12. // Quick Price Guide
  13. $homeair = $_POST['fromhomeairport'];
  14. $airport = $_POST['fromairport'];
  15. $town = $_POST['fromtown'];
  16. $rtnairport = $_POST['fromrtnairport'];
  17. $arrdate = $_POST['fromarrdate'];
  18. $depdate = $_POST['fromdepdate'];
  19. $cost = $_POST['fromcost'];
  20. $vehicle = $_POST['fromvehicle'];
  21. $return = $_POST['fromreturn'];
  22.  
  23. // Booking Form
  24. $title = $_POST['fromtitle'];
  25. $name = $_POST['fromname'];
  26. $surname = $_POST['fromsurname'];
  27. $mobile = $_POST['frommobile'];
  28.  
  29. $flight = $_POST['fromarrflight'];
  30. $airline = $_POST['fromairline'];
  31. $hours = $_POST['fromhours'];
  32. $minutes = $_POST['fromminutes'];
  33. $ampm = $_POST['fromampm'];
  34. $adults = $_POST['fromadults'];
  35. $kids = $_POST['fromkids'];
  36. $lcases = $_POST['fromlcase'];
  37. $scases = $_POST['fromscase'];
  38. $hotel = $_POST['fromhotela'];
  39. $rtnflight = $_POST['fromrtnflight'];
  40. $rtnairline = $_POST['fromrtnairline'];
  41. $rtnhotel = $_POST['fromhotelb'];
  42. $rtnhours = $_POST['fromrtnhours'];
  43. $rtnminutes = $_POST['fromrtnminutes'];
  44. $rtnampm = $_POST['fromrtnampm'];
  45. $rtnflhours = $_POST['fromrtnflhours'];
  46. $rtnflminutes = $_POST['fromrtnflminutes'];
  47. $rtnflampm = $_POST['fromrtnflampm'];
  48. $message = $_POST['frommessage'];
  49.  
  50. $content = "Just-Aitports Executive Travel" . "\n\n";
  51.  
  52. $content .= "95 Wilton Road" . "\n";
  53. $content .= "Suite 3" . "\n";
  54. $content .= "London SW1V 1BZ" . "\n";
  55. $content .= "United Kingdom" . "\n\n\n";
  56.  
  57.  
  58. $content .= "For International Service Contacts:" . "\n\n";
  59.  
  60. $content .= "Tel: +44 (0)20 3318 0632" . "\n";
  61. $content .= "Fax: +44 (0)20 30041756" . "\n";
  62. $content .= "Email: info@just-airports.net" . "\n\n\n\n";
  63.  
  64. $content .= "*** INTITIAL BOOKING CONFIRMATION ***" . "\n\n\n";
  65.  
  66. $content .= "From: " . $title . " " . $name . " " . $surname . "\n";
  67. $content .= "Mobile No.: " . $mobile . "\n";
  68. $content .= "Email: " . $email . "\n\n";
  69. $content .= "Customer is flying from: " . $homeair . "\n";
  70. $content .= "Landing at: " . $airport . " on " . $arrdate . "\n";
  71. $content .= "Flight No.: " . $flight . " Flying with: " . $airline . "\n";
  72. $content .= "Flight Lands at: " . $hours . ":" . $minutes . $ampm . "\n";
  73. $content .= "No. of Adults: " . $adults . " No. of Children: " . $kids . "\n";
  74. $content .= "No. of Large cases: " . $lcases . " - No. of Small Cases: " . $scases . "\n";
  75. $content .= "Vehicle Requested is: " . $vehicle . "\n";
  76. $content .= "Staying at: " . $hotel . " in " . $town . "\n\n";
  77.  
  78. $content .= "Return Journey?: " . $return . "\n";
  79. $content .= "Return Flight No.: " . $rtnflight . " - Airline: " . $rtnairline . "\n";
  80. $content .= "Returning on: " . $depdate . "\n";
  81. $content .= "Collect from: " . $rtnhotel . "\n";
  82. $content .= "Going to: " . $rtnairport . "\n";
  83. $content .= "Collection Time from Hotel/Villa: " . $rtnhours . ":" . $rtnminutes . $rtnampm . "\n";
  84. $content .= "Flight Departure Time: " . $rtnflhours . ":" . $rtnflminutes . $rtnflampm . "\n\n";
  85.  
  86. $content .= "Total Cost: Euro€" . $cost . " (Payment confirmation to follow)" . "\n\n";
  87.  
  88. $content .= "** PLEASE NOTE **" . "\n\n";
  89. $content .= "1 - This is an 'Initial Booking' only. Bookings can only be confirmed as valid," . "\n";
  90. $content .= " when produced together with a 'Payment Confirmation' email." . "\n";
  91. $content .= "2 - Without a 'Successfull Payment Confirmation', all 'Initial Boolkings' will be classed as void." . "\n\n\n";
  92.  
  93. $content .= "MESSAGE:" . "\n\n";
  94. $content .= $message . "\n\n\n\n\n\n\n";
  95.  
  96.  
  97.  
  98. if (mail($sendto,$subject,$content,$emailto))
  99. {
  100. header ("Location: http://www.just-airports.net/payments.php");
  101. echo 'response=passed';
  102. echo $name;
  103.  
  104. }
  105. else
  106. {
  107. echo 'response=failed';
  108. }
  109.  
  110.  
  111. /////////////////////////////////////////////////////////////////////////////
  112. //here we are going to add the variables to 
  113. $_SESSION['homeair'] = $_POST['fromhomeairport'];
  114. $_SESSION['airport'] = $_POST['fromairport'];
  115. $_SESSION['town'] = $_POST['fromtown'];
  116. $_SESSION['rtnairport'] = $_POST['fromrtnairport'];
  117. //like wise store all the data
  118. ?> 
  119.  
so on the other page (page where you gonna display the data

Expand|Select|Wrap|Line Numbers
  1. session_start();
  2.  
  3. echo $_SESSION['homeair'];
  4. echo $_SESSION['airport'];
  5. //.....
  6.  
remember session_start(); should be the first line of both pages
just after the <?php tag

Regards

10 1460
chathura86
227 100+
First thing is php cannot open a page,

what you can do is capture the form data and sore it some where
(db, file, session) depends on your requirement. and create another
php page (you can use the same also) which will display that data
the way you want.

so if some one request that page from a browser he can view those data.
if you want the person who submit the data to see them, then use
Action Script or something to open a browser window and direct him to that page

Regards
Chathura Bamunusinghe
Mar 31 '10 #2
MickyD
5
Ok..?

I have the flash file open another webpage after they click submit, that works fine. But what I can't seem to get my head round is how to display the data entered in that form, on the new Page? ...how do I go about setting a 'session'? ..and how do I instruct PHP to pull the data from it?

Sorry if this sounds a bit confusing, I'm fairly new to PHP.

Mick!
Mar 31 '10 #3
chathura86
227 100+
could you please post the php script you are using to send the mail

that will help me to explain it in detail

Regards
Mar 31 '10 #4
MickyD
5
Here you go...

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. $headers = "MIME-Version: 1.0\r\n";
  4. $headers .= "Content-type: text/html; charset=windows-1251\r\n";
  5.  
  6. $email = $_POST['fromemail'];
  7. $sendto = "info@just-airports.net, $email";
  8. $subject = 'Booking from Just-Airports.net Website';
  9.  
  10. // Quick Price Guide
  11. $homeair = $_POST['fromhomeairport'];
  12. $airport = $_POST['fromairport'];
  13. $town = $_POST['fromtown'];
  14. $rtnairport = $_POST['fromrtnairport'];
  15. $arrdate = $_POST['fromarrdate'];
  16. $depdate = $_POST['fromdepdate'];
  17. $cost = $_POST['fromcost'];
  18. $vehicle = $_POST['fromvehicle'];
  19. $return = $_POST['fromreturn'];
  20.  
  21. // Booking Form
  22. $title = $_POST['fromtitle'];
  23. $name = $_POST['fromname'];
  24. $surname = $_POST['fromsurname'];
  25. $mobile = $_POST['frommobile'];
  26.  
  27. $flight = $_POST['fromarrflight'];
  28. $airline = $_POST['fromairline'];
  29. $hours = $_POST['fromhours'];
  30. $minutes = $_POST['fromminutes'];
  31. $ampm = $_POST['fromampm'];
  32. $adults = $_POST['fromadults'];
  33. $kids = $_POST['fromkids'];
  34. $lcases = $_POST['fromlcase'];
  35. $scases = $_POST['fromscase'];
  36. $hotel = $_POST['fromhotela'];
  37. $rtnflight = $_POST['fromrtnflight'];
  38. $rtnairline = $_POST['fromrtnairline'];
  39. $rtnhotel = $_POST['fromhotelb'];
  40. $rtnhours = $_POST['fromrtnhours'];
  41. $rtnminutes = $_POST['fromrtnminutes'];
  42. $rtnampm = $_POST['fromrtnampm'];
  43. $rtnflhours = $_POST['fromrtnflhours'];
  44. $rtnflminutes = $_POST['fromrtnflminutes'];
  45. $rtnflampm = $_POST['fromrtnflampm'];
  46. $message = $_POST['frommessage'];
  47.  
  48. $content = "Just-Aitports Executive Travel" . "\n\n";
  49.  
  50. $content .= "95 Wilton Road" . "\n";
  51. $content .= "Suite 3" . "\n";
  52. $content .= "London SW1V 1BZ" . "\n";
  53. $content .= "United Kingdom" . "\n\n\n";
  54.  
  55.  
  56. $content .= "For International Service Contacts:" . "\n\n";
  57.  
  58. $content .= "Tel: +44 (0)20 3318 0632" . "\n";
  59. $content .= "Fax: +44 (0)20 30041756" . "\n";
  60. $content .= "Email: info@just-airports.net" . "\n\n\n\n"; 
  61.  
  62. $content .= "*** INTITIAL BOOKING CONFIRMATION ***" . "\n\n\n";
  63.  
  64. $content .= "From:  " . $title . " " . $name . " " . $surname . "\n";
  65. $content .= "Mobile No.: " . $mobile . "\n";
  66. $content .= "Email: " . $email . "\n\n";
  67. $content .= "Customer is flying from: " . $homeair . "\n";
  68. $content .= "Landing at: " . $airport . "  on " . $arrdate . "\n";
  69. $content .= "Flight No.: " . $flight . "  Flying with: " . $airline . "\n";
  70. $content .= "Flight Lands at: " . $hours . ":" . $minutes . $ampm . "\n";
  71. $content .= "No. of Adults: " . $adults . "   No. of Children: " . $kids . "\n";
  72. $content .= "No. of Large cases: " . $lcases . "  - No. of Small Cases: " . $scases . "\n";
  73. $content .= "Vehicle Requested is: " . $vehicle . "\n";
  74. $content .= "Staying at: " . $hotel . " in " . $town . "\n\n";
  75.  
  76. $content .= "Return Journey?: " . $return . "\n";
  77. $content .= "Return Flight No.: " . $rtnflight . "  - Airline: " . $rtnairline . "\n";
  78. $content .= "Returning on: " . $depdate . "\n";
  79. $content .= "Collect from: " . $rtnhotel . "\n";
  80. $content .= "Going to: " . $rtnairport . "\n";
  81. $content .= "Collection Time from Hotel/Villa: " . $rtnhours . ":" . $rtnminutes . $rtnampm . "\n";
  82. $content .= "Flight Departure Time: " . $rtnflhours . ":" . $rtnflminutes . $rtnflampm . "\n\n";
  83.  
  84. $content .= "Total Cost: Euro€" . $cost . " (Payment confirmation to follow)" . "\n\n";
  85.  
  86. $content .= "** PLEASE NOTE **" . "\n\n";
  87. $content .= "1 - This is an 'Initial Booking' only. Bookings can only be confirmed as valid," . "\n";
  88. $content .= "    when produced together with a 'Payment Confirmation' email." . "\n";
  89. $content .= "2 - Without a 'Successfull Payment Confirmation', all 'Initial Boolkings' will be classed as void." . "\n\n\n";
  90.  
  91. $content .= "MESSAGE:" . "\n\n";
  92. $content .= $message . "\n\n\n\n\n\n\n";
  93.  
  94.  
  95.  
  96. if (mail($sendto,$subject,$content,$emailto))
  97. {
  98.      header ("Location: http://www.just-airports.net/payments.php"); 
  99.     echo 'response=passed';
  100.     echo $name;
  101.  
  102. }
  103. else
  104. {
  105.     echo 'response=failed';
  106. }
  107.  
  108. ?>
Mar 31 '10 #5
Dormilich
8,658 Expert Mod 8TB
@chathura86
only true to a limited extend.

PHP is certainy able to get a page (various functions can use an URL as parameter, and there is also cURL), that is, it gets the source code. whether it can use any embedded content like flash is a different thing.
Mar 31 '10 #6
chathura86
227 100+
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. session_start(); //this will start the session
  4.  
  5. $headers = "MIME-Version: 1.0\r\n";
  6. $headers .= "Content-type: text/html; charset=windows-1251\r\n";
  7.  
  8. $email = $_POST['fromemail'];
  9. $sendto = "info@just-airports.net, $email";
  10. $subject = 'Booking from Just-Airports.net Website';
  11.  
  12. // Quick Price Guide
  13. $homeair = $_POST['fromhomeairport'];
  14. $airport = $_POST['fromairport'];
  15. $town = $_POST['fromtown'];
  16. $rtnairport = $_POST['fromrtnairport'];
  17. $arrdate = $_POST['fromarrdate'];
  18. $depdate = $_POST['fromdepdate'];
  19. $cost = $_POST['fromcost'];
  20. $vehicle = $_POST['fromvehicle'];
  21. $return = $_POST['fromreturn'];
  22.  
  23. // Booking Form
  24. $title = $_POST['fromtitle'];
  25. $name = $_POST['fromname'];
  26. $surname = $_POST['fromsurname'];
  27. $mobile = $_POST['frommobile'];
  28.  
  29. $flight = $_POST['fromarrflight'];
  30. $airline = $_POST['fromairline'];
  31. $hours = $_POST['fromhours'];
  32. $minutes = $_POST['fromminutes'];
  33. $ampm = $_POST['fromampm'];
  34. $adults = $_POST['fromadults'];
  35. $kids = $_POST['fromkids'];
  36. $lcases = $_POST['fromlcase'];
  37. $scases = $_POST['fromscase'];
  38. $hotel = $_POST['fromhotela'];
  39. $rtnflight = $_POST['fromrtnflight'];
  40. $rtnairline = $_POST['fromrtnairline'];
  41. $rtnhotel = $_POST['fromhotelb'];
  42. $rtnhours = $_POST['fromrtnhours'];
  43. $rtnminutes = $_POST['fromrtnminutes'];
  44. $rtnampm = $_POST['fromrtnampm'];
  45. $rtnflhours = $_POST['fromrtnflhours'];
  46. $rtnflminutes = $_POST['fromrtnflminutes'];
  47. $rtnflampm = $_POST['fromrtnflampm'];
  48. $message = $_POST['frommessage'];
  49.  
  50. $content = "Just-Aitports Executive Travel" . "\n\n";
  51.  
  52. $content .= "95 Wilton Road" . "\n";
  53. $content .= "Suite 3" . "\n";
  54. $content .= "London SW1V 1BZ" . "\n";
  55. $content .= "United Kingdom" . "\n\n\n";
  56.  
  57.  
  58. $content .= "For International Service Contacts:" . "\n\n";
  59.  
  60. $content .= "Tel: +44 (0)20 3318 0632" . "\n";
  61. $content .= "Fax: +44 (0)20 30041756" . "\n";
  62. $content .= "Email: info@just-airports.net" . "\n\n\n\n";
  63.  
  64. $content .= "*** INTITIAL BOOKING CONFIRMATION ***" . "\n\n\n";
  65.  
  66. $content .= "From: " . $title . " " . $name . " " . $surname . "\n";
  67. $content .= "Mobile No.: " . $mobile . "\n";
  68. $content .= "Email: " . $email . "\n\n";
  69. $content .= "Customer is flying from: " . $homeair . "\n";
  70. $content .= "Landing at: " . $airport . " on " . $arrdate . "\n";
  71. $content .= "Flight No.: " . $flight . " Flying with: " . $airline . "\n";
  72. $content .= "Flight Lands at: " . $hours . ":" . $minutes . $ampm . "\n";
  73. $content .= "No. of Adults: " . $adults . " No. of Children: " . $kids . "\n";
  74. $content .= "No. of Large cases: " . $lcases . " - No. of Small Cases: " . $scases . "\n";
  75. $content .= "Vehicle Requested is: " . $vehicle . "\n";
  76. $content .= "Staying at: " . $hotel . " in " . $town . "\n\n";
  77.  
  78. $content .= "Return Journey?: " . $return . "\n";
  79. $content .= "Return Flight No.: " . $rtnflight . " - Airline: " . $rtnairline . "\n";
  80. $content .= "Returning on: " . $depdate . "\n";
  81. $content .= "Collect from: " . $rtnhotel . "\n";
  82. $content .= "Going to: " . $rtnairport . "\n";
  83. $content .= "Collection Time from Hotel/Villa: " . $rtnhours . ":" . $rtnminutes . $rtnampm . "\n";
  84. $content .= "Flight Departure Time: " . $rtnflhours . ":" . $rtnflminutes . $rtnflampm . "\n\n";
  85.  
  86. $content .= "Total Cost: Euro€" . $cost . " (Payment confirmation to follow)" . "\n\n";
  87.  
  88. $content .= "** PLEASE NOTE **" . "\n\n";
  89. $content .= "1 - This is an 'Initial Booking' only. Bookings can only be confirmed as valid," . "\n";
  90. $content .= " when produced together with a 'Payment Confirmation' email." . "\n";
  91. $content .= "2 - Without a 'Successfull Payment Confirmation', all 'Initial Boolkings' will be classed as void." . "\n\n\n";
  92.  
  93. $content .= "MESSAGE:" . "\n\n";
  94. $content .= $message . "\n\n\n\n\n\n\n";
  95.  
  96.  
  97.  
  98. if (mail($sendto,$subject,$content,$emailto))
  99. {
  100. header ("Location: http://www.just-airports.net/payments.php");
  101. echo 'response=passed';
  102. echo $name;
  103.  
  104. }
  105. else
  106. {
  107. echo 'response=failed';
  108. }
  109.  
  110.  
  111. /////////////////////////////////////////////////////////////////////////////
  112. //here we are going to add the variables to 
  113. $_SESSION['homeair'] = $_POST['fromhomeairport'];
  114. $_SESSION['airport'] = $_POST['fromairport'];
  115. $_SESSION['town'] = $_POST['fromtown'];
  116. $_SESSION['rtnairport'] = $_POST['fromrtnairport'];
  117. //like wise store all the data
  118. ?> 
  119.  
so on the other page (page where you gonna display the data

Expand|Select|Wrap|Line Numbers
  1. session_start();
  2.  
  3. echo $_SESSION['homeair'];
  4. echo $_SESSION['airport'];
  5. //.....
  6.  
remember session_start(); should be the first line of both pages
just after the <?php tag

Regards
Mar 31 '10 #7
chathura86
227 100+
only true to a limited extend.

PHP is certainy able to get a page (various functions can use an URL as parameter, and there is also cURL), that is, it gets the source code. whether it can use any embedded content like flash is a different thing.
yeah.. my mistake what i really meant is that php cannot open a browser window. i totally agree with you

Regards
Mar 31 '10 #8
MickyD
5
Thanks Chathura..
I'll give that a go, and let you know how I get on!

Mick!
Mar 31 '10 #9
MickyD
5
Chathura.... I love you and want to have your Babies!!
Mar 31 '10 #10
chathura86
227 100+
you are welcome

pleas select the best answer, so other can find the solution easily

Regards
Chathura
Mar 31 '10 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: vp | last post by:
Can I safely assume that all static variables are initialized as NULL or zero, depending on the types of the variables, no matter on which platform that app is compiled ? Thanks for your help, ...
0
by: msquaredonline | last post by:
I have an ASP page that loops through a database and adds up score results (that were received from a Flash survey I created) and adds up the number of results (to be later used to determine the...
4
by: gladhuman | last post by:
Hi, Let's assume that I have the following structure and the following array: struc My_struct { char var_one; char var_two; char var_three;
2
by: Military Smurf | last post by:
I am interested in dumping some results from a collection I have into a group of variables. I have a counter that loops but I don't know how to use the counter to determine my variable names. ...
111
by: Nate | last post by:
Hello, I am looking for a method to automatically declare variables in C. I'm not sure if there is a good way to do this, but I had something like this in mind... int i; for(i = 1; i < 4;...
0
by: cytan7411 | last post by:
Hello, I have a website up and includes two textboxes and a button. It is basically a front-end system to log into a 3rd parties PHP script. I have uploaded the flash source to...
0
by: lilacarreto | last post by:
Hi! how can i export flash variables to dotnetnuke? I havet make a game in flash and that game is included in a website developed in dotnetnuke. thanks!
0
chunkny
by: chunkny | last post by:
I'm having a little trouble getting a FLV player component to work dynamically. When the information is hardcoded from Flash MX 2004, everything works fine, but the problem is that my website is...
0
by: zechdc | last post by:
I have been at this for two weeks now. I am trying to send two variables from a flash file located on newgrounds.com, kongregate.com, armorgames.com or any other site like that to a php file on my...
1
by: Omega | last post by:
Hello, For my flash project I want to read variables from a text file and store them locally in flash variables. This workes fine if I put everything directly inside the flash project file...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
tracyyun
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...
0
isladogs
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.