Is there an easy way to email data to myself in Flash without using php?

Discussion in 'Web Design and Development' started by chrono1081, Apr 30, 2011.

  1. chrono1081, Apr 30, 2011
    Last edited: Apr 30, 2011

    chrono1081 macrumors 604

    chrono1081

    Joined:
    Jan 26, 2008
    Location:
    Isla Nublar
    #1
    Hi guys,

    I am helping a friend work on a flash program (made in Flash CS5) and we are trying to find an easy way to email data from a text box to an email address without needing to use a php file. Is this possible?

    Basically here is what I have:

    I have four text boxes, I know how to get the text out of them so thats not a problem. I also have a send button that I can trace the contents of the text boxes after I click them. (So I know the data is being read correctly).

    What I want to do is have it to when I click the "send" button the data in the four text boxes is automatically sent to an email address I specify. Is there a way to do this? Any help would be greatly appreciated :)


    EDIT: I looked at the mailto command but it pops up my desktop mail client :( I'm trying to find a way where the data just clears off the text boxes and the data in them is sent.
     
  2. lucidmedia macrumors 6502a

    Joined:
    Oct 13, 2008
    Location:
    Wellington, New Zealand
    #2
    You can use loadvars to pass the data to a php file... From there you can pass it to a database, email it, etc.

    Google "flash php contact form" for some examples of this...
     
  3. chrono1081 thread starter macrumors 604

    chrono1081

    Joined:
    Jan 26, 2008
    Location:
    Isla Nublar
    #3
    Thank you for the suggestion, unfortunately we can't use php :(

    Do you know of a way to do this without php files by chance? From the tutorials I saw you have to have the flash website up and hosted and the host has to support it. The flash project won't be hosted on a site that can support php.
     
  4. web_god61 macrumors regular

    web_god61

    Joined:
    May 14, 2004
    #4
    1) No, this is not possible as flash runs on the client and emails must be sent using the server (asp.net / php).

    2) Every low-end garbage web hosts supports php. Unless your running on a free host, just pay the $3 a month.
     
  5. chrono1081 thread starter macrumors 604

    chrono1081

    Joined:
    Jan 26, 2008
    Location:
    Isla Nublar
    #5
    Thank you for letting me know its not possible. The website has to go up on Penn States servers which don't seem to support PHP for the section that students can upload to :/

    We made a work around though by printing the data in the form to the output console that way the professor can see that the data was being read from the text boxes.
     
  6. lucidmedia macrumors 6502a

    Joined:
    Oct 13, 2008
    Location:
    Wellington, New Zealand
    #6
    Flash's security restrictions require you to have something running on the server to handle the data... if you cant use PHP you could go old-school and use CGI or some other server-side scripting.
     
  7. web_god61 macrumors regular

    web_god61

    Joined:
    May 14, 2004
    #7
    ^ if php is disabled, its safe to assume all scripting is disable for the same reason.

    Glad you found a solution. Knowing more about your setup, if you still wanted to send an email, you can keep the server script on the professors account which may have scripting enabled. You only need one php file (and not one for every student) that every student can access from flash via post/get.

    So if your scrip is at ...com/~professor_jack/emailer.php, in flash send a request to ..com/~professor_jack/emailer.php?email=email&val2=val.
     

Share This Page