A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: setting up a form - with php

  1. #1
    Senior Member
    Join Date
    Oct 2003
    Location
    right here, right now
    Posts
    121

    setting up a form - with php

    Hi There,
    This forum has been really helpful with all my troubles, thanks to all you helpful people out there!!

    My NEXT problem!!
    This is driving me a little mad now as I've made a form before, using php in an HTML website, and all worked fine.

    I don't know quite what is going wrong though I'm not getting any test emails I'm sending to myself to gets my form working???

    All I want is a general form which connects to a php page sending the info to my email

    At first I though the problem was that all my swf files were in a folder, not the root directory where all the HTML pages are and the php page. So I put a test swf in the root thinking it might help, it didn't?

    I'd really apprieciate it if someone could help me to sort this out

    I just don't seem to be getting this, I even tried working through a tutorial on the kirupa website..... arggh

  2. #2
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Where did you load the php script to?

  3. #3
    Senior Member
    Join Date
    Oct 2003
    Location
    right here, right now
    Posts
    121
    HI there!

    I loaded the php file into the root directory with all my html files.

    I'm using a host company called www.simply.com which does support php files

    The swf files are all in a seperate folder. I though this may have been the problem though taking the swf file out the folder and into the root didn't solve anything


    FOR reference this is what I've got

    a send button on the form with:


    on (release) {
    if (name eq "" or subject eq "" or message eq "" or email eq "") {
    stop();
    } else {
    loadVariablesNum("form.php", 0, "POST");
    gotoAndStop(33);
    }
    }


    a reset button with:

    on (release) {
    name = "";
    subject = "";
    message = "";
    email = "";
    }


    and form.php has:


    <?

    $to = "elliot.robert@mtwenty5.co.uk";
    $msg = "$name\n\n";
    $msg .= "$message\n\n";

    mail($to, $subject, $msg, "From: My web site\nReply-To: $email\n");

    ?>



    thanks for your time, hope it make sense

  4. #4
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    The swf should be in root with the php file. At least mine is. Also, the php file must upload as ASCII, not binary, or it gets corrupted.

  5. #5
    Senior Member
    Join Date
    Oct 2003
    Location
    right here, right now
    Posts
    121
    the php file must upload as ASCII, not binary
    can I ask you how you upload the .php file as ASCII ??

    thanks

  6. #6
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    I use WS_FTP. but you have to add php to the options.

    How did you upload your php file?

  7. #7
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    You might need to make a couple of changes to your php script (depending on your php settings)

    it is safer to use

    <?php

    as the opening php tag instead of

    <?

    as the use of <? is often disabled.

    Your script currently assumes that php is set up with the setting register_globals turned on. This was the default a while ago (up until one of the early(ish) versions of php 4) when the default was changed to off. The change was made as the previous setting causes big security problems, and most hosts should now be running PHP with register_globals turned off.

    With register globals off when you send variables to the script they will not automatically be created for you (like your $name, $message etc... variables) instead you need to extract them from the $_POST array - or the $_GET array if the variables were sent using the GET method.

    for example,

    $name = !empty($_POST['name']) ? $_POST['name'] : '';

    would check the $_POST array for a variable named name - if this was found a variable called $name would be created using the value in $_POST['name'] - otherwise $name would be set to contain an empty string.

  8. #8
    Senior Member
    Join Date
    Oct 2003
    Location
    right here, right now
    Posts
    121
    Originally posted by iaskwhy
    I use WS_FTP. but you have to add php to the options.

    How did you upload your php file?
    I use ws_ftp pro and I simply dragged the file into the right hand window which has all the file for the site, no need to add php to any options?


    Originally posted by catbert303
    it is safer to use
    <?php
    as the opening php tag
    I have added that now though I haven't got the "Golden" first test email back yet ,
    to be honest I find anything code related pretty hard, I understand what it's suppose to do

    I've tried quite a few different versions of the same thing, I've uploaded one that seems alot better though can't remember where I got it from and can't find a .fla file to see what goes with it.

    Would either of you be able to tell me what I'd have on the flash form to work with the attached .php file

    thanks guys!
    Attached Files Attached Files

  9. #9
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    In WS_FTP, click on Option along the bottom, then check the ASCII file names in the box. PHP should be there. If not, add it. Then try uploading again.

    Look at the picture.

    And you need to change this to the e-mail address:

    $adminaddress = "test.maverik.tv";
    Attached Images Attached Images
    Last edited by iaskwhy; 02-20-2005 at 12:59 PM.

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