A Flash Developer Resource Site

Results 1 to 17 of 17

Thread: Contact form

  1. #1
    Member
    Join Date
    Apr 2006
    Posts
    94

    Contact form

    Hi,

    I want to make a simple contact form with 3DFA.
    It has to be able to send some text and checkbox results...

    How can I start with this??

    I don't know anything about databases and stuff...
    Is it possible to use a form processor like www.formlog.com ? (I used it with a HTML site)

    Hope someone can help me out!

  2. #2
    Game Master ConnELITE's Avatar
    Join Date
    Apr 2005
    Location
    United States, DC
    Posts
    474
    Umm I know some php and database stuff that would work. Give me a day to make it cause I'm busy right now, maybe someone else has a better way though. One day ...
    BC

  3. #3
    Member
    Join Date
    Apr 2006
    Posts
    94
    Ok thanks a lot connELITE
    I'm also trying some stuff, but so far with no luck...
    All other suggestions are welcome

    Thnx

  4. #4
    Senior Member
    Join Date
    May 2005
    Posts
    163
    I not familiar with a form processor but looked at it briefly and I think if you use the movie function postURL() either method could be done.

    The form processor looks easier since you don't have to do all the middleware to talk to the database.

  5. #5
    Game Master ConnELITE's Avatar
    Join Date
    Apr 2005
    Location
    United States, DC
    Posts
    474
    Well ppedz is going down the right path, but it's a little more complex then that. Can I ask, would you like these forms email to you or collected in a database or something? Cause email would be a lot easier. I'm just wondering before I start making it.
    BC

  6. #6
    Member
    Join Date
    Apr 2006
    Posts
    94
    E-mail would be good enough for me, but preferrably not just through the default e-mail client, because it would cause difficulties if none is selected or oulook is default and no configuration had been made. That's why I asked if the use of a form processor is possible.

    Grtz

  7. #7
    Game Master ConnELITE's Avatar
    Join Date
    Apr 2005
    Location
    United States, DC
    Posts
    474
    Ok, I've attached a movie and a php script. There's a couple things you need to do so listen carefully. First of all, you need to edit the php. Unzip the zip and open the php in NOTEPAD (very important). It's going to look like this...

    PHP Code:
    <?php
    $to 
    "youremail@watever.com";
    $subject "Form";
    $body $_POST['Userinput'];
    if (
    mail($to$subject$body)) {
      echo 
    "&complete=Form sent!";
     } else {
      echo 
    "&complete=Sorry, can't send form at this moment.  Please try again later.";
     }
    ?>
    See this part, $to = "youremail@watever.com"; , change it to your email then click save as, mail.php (make sure you include the .php).

    This flash communicates with the php, so your going to need upload it to your server then get the url (say it's http://www.Hey.com/mail.php). Now go into the starting script of the movie I sent you and replace http://www.yoursite.com/mail.php with your url (http://www.Hey.com/mail.php).

    If your using AOL, AOL and some other web mail will send php sent mail into the spam folder, so check there and report it as "this is not spam" or something.

    Ok, reply if you have any questions.

    -Brent
    Attached Files Attached Files
    BC

  8. #8
    Member
    Join Date
    Apr 2006
    Posts
    94
    Hi,

    Thanks a lot for the script!
    I did everything exact as you told me to, but i didn't manage to get it work...
    Always "Sorry, can't send form at this moment. Please try again later."

    I mailed dommel (my hosting) to make sure PHP is supported and to ask if the php file should be in a specific directory or something...
    Hope they answer soon and i can get it to work...

    Thanks a lot
    Last edited by my_6th_sense; 06-17-2006 at 10:18 AM.

  9. #9
    Game Master ConnELITE's Avatar
    Join Date
    Apr 2005
    Location
    United States, DC
    Posts
    474
    Hmm, can you send me the php and movie file that you edited? I'll try it on my server and see whats up. Don't change anything so I can see if it's a syntax error. If your getting back the error message it means the php is working but maybe you don't have the mail function enabled on your server. It could also mean you messed up the syntax of the php perhaps in the $to area. But yeh, just post it and I'll try it on mine.
    Last edited by ConnELITE; 06-17-2006 at 11:51 AM.
    BC

  10. #10
    Member
    Join Date
    Apr 2006
    Posts
    94
    Hey,
    hnx for the fast reply
    Here are the files...
    I hope the server supports the mail function...I recently heard that it's possible that the mail function might not be supported on a server, is this possible?
    Greets
    Attached Files Attached Files

  11. #11
    Game Master ConnELITE's Avatar
    Join Date
    Apr 2005
    Location
    United States, DC
    Posts
    474
    yeh your syntax is alright. I believe you are using a free server and it seems it's not even letting you run php. I loaded the php and I got it back as a text file which means it's not reading it. I suggest finding a new server or buying a real one.
    BC

  12. #12
    Member
    Join Date
    Apr 2006
    Posts
    94
    Thnx a lot ConnELITE, I got it to work on a new server with PHP support

  13. #13
    ©KatSOft katsoft's Avatar
    Join Date
    Aug 2004
    Location
    Romania
    Posts
    138
    Hi, I was reding the post and it's exactly what happend to me . I used this script for e-mails :
    <?
    $detail = str_replace("\r", "\n", $detail);
    $to = "tjuays@gmail.com";
    $msg = "Name of sender: $title $name\n\n";
    $msg .= "Contact number: $contactul\n\n";
    $msg .= "Date of His Event: $eventul\n\n";
    $msg .= "Details: $detail\n\n";
    $reply = "From: Pop's Photo\n";
    $reply .= "Reply-To: $email\n";

    mail($to, $subject, $msg, $reply);

    ?>

    and worked on my server but when I gave it to my customer it didn't work. He has a server that he sais supports php is something wrong with the script ?....again it works on my server.


    Thank you.

  14. #14
    Member
    Join Date
    Apr 2006
    Posts
    94
    Hi,

    ConnELITE, i think i need your help again
    I tried to add checkboxes and radiobuttons on serveral ways, but nothing seems to work to get the script to send the check/radiobutton rusults to my email...Only the text from the edit box is sent to my email...
    Any solution?
    Thnx a lot!

    Grtz

  15. #15
    Game Master ConnELITE's Avatar
    Join Date
    Apr 2005
    Location
    United States, DC
    Posts
    474
    Katsoft, it could be a number of things. It could be that...

    -your client is using an older version of php
    -he is not saving the php in the right directory
    -his host has blocked outside php communication (very common)

    If I was you, I would add an error check in mine where a success or fail message will be displayed. Also, I suggest having the flash post the link to the php in a new window, that way you can see any errors. Other then that, I don't really know.

    my 6th sense, can I suggest using the radio buttons and check boxes to edit the editbox? Like if they click "yes" to question number one, have your edit box say "question one: yes". If that doesn't help, post the MOVIE of what you tried to do with the radio buttons and I'll modify it a bit.

    -Brent
    Last edited by ConnELITE; 06-23-2006 at 01:47 PM.
    BC

  16. #16
    Senior Member sadako232's Avatar
    Join Date
    Mar 2006
    Posts
    153
    ha, ConnELITE nice form... i made one similier but my php was wrong -.-... go figure then i encountered the same problem with having a free server...

    P.S. i hate angelfire

  17. #17
    Junior Member
    Join Date
    Jul 2003
    Location
    Israel
    Posts
    24

    subject

    hi it work but how do i insert subject?
    or user mail to massage?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center