dcsimg
A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: HTML 2 PHP 2 Flash?

  1. #1
    Member
    Join Date
    Dec 2000
    Posts
    32

    HTML 2 PHP 2 Flash?

    Hi everyone!

    I am able to work with a Flash Form directed to a PHP code and results to a email or HTML page. My problem is that I want to do the other way around... Here it goes :

    1- I have a flashform.html page that contains a Flash form called flashform.swf . In this form, one of the field is called stylenum (variable). The user fills the form and clicks the Send button. It is passed through a flashform.php code and results towards an email address or an HTML page. This works fine!

    2- I have another HTML page called products.html, The page contains various products that have each a number assigned to it (ex. DA4377). Under each product there is a button or link that corresponds to its number (this is where starts what I wand to do) and the user when clicking the button or link, opens the flashform.html with the flashform.swf and that DA4377 StyleNumber appears automatically inside the stylenum field ready to be sent with the rest of the form.

    I would be greatfull for any help in the process of doing this!

    Thanks.

    I use WinXP and Flash MX, PHP+MySQL.

    Daniel Victor

  2. #2
    Registered User
    Join Date
    Feb 2001
    Posts
    13,044
    Hi,

    the usual way would be to call flashform.html?style=DA4377
    Now the html page would include javascript like
    <script>
    document.write('<object....>'+
    '<param name=movie value="flashform.swf'+location.search+'">'+
    '<....>'+
    '<embed src="flashform.swf'+location.search+'" width=....>'+
    '</embed></object>');
    </script>

    Also, you could call up a flashform.php in the same way and add the variable to the swf name

    Musicman

  3. #3
    Member
    Join Date
    Dec 2000
    Posts
    32

    Call from HTML

    Hello Musicman and Thank you for your Help...

    But I forgot to tell you that I am a novice in programming, so sorry for that. I know a bit of PHP and I am beginning to understand it more and more. JavaScript I don't program but play around with it...

    I'll try to be more specific about my needs...

    Pretending: Lets suppose I have a submit button attached to each object in my product.html page and that a Hidden Input is attached to the submit button (hidden value=DA4377) (and so on for other products). When clicked, this submit button calls the corresponding $DA4377 variable in the flashform.php file. The results opens the flashform.swf (in its HTML supporting file) and writes down DA4377 in the stylenum field, or DA4388 or DA4276 or else depending on the users choice, of the Flash Form.

    Is this possible or could it be done some other ways?

    For instance I am using this simple PHP script for mail from Flash forms or HTML forms: This is for Flash mail:

    <HTML>

    <HEAD>

    <TITLE>Mail</TITLE>

    <BODY>


    <?php


    $TextVariable = '&results=';


    echo $TextVariable;

    echo $response;

    mail ("my@mymail.com", "From location of Form", "

    From location of Form

    ARTIST Name: $ARTISTName

    Tel: $Tel

    Email: $Email

    Sent From : $REMOTE_ADDR


    ");


    ?>

    </body>

    </html>

    Could this script be modify to recieve the DA4377 number from a submit button and write it down into a Flash Field of a form?


    BTW, xcuse my ignorence but what do you use to make the action CALL (IE : call flashform.html?style=DA4377).


    Thank you so much!

    Daniel Victor.

  4. #4
    Registered User
    Join Date
    Feb 2001
    Posts
    13,044
    Hi,

    you want to open a html (or php) page from flash - that is
    getURL('flashform.php?style=DA4577', '_blank')
    [use _self if you want to replace the flash movie]
    Now in your flashform.php, you have
    <?
    $style = $_GET[style]; // this line required for php 4.1 or later
    ?>
    <object ....>
    <param name=movie value="flashform.swf?style=<?=$style?>">

    <embed src="flashform.swf?style=<?=$style?>" width=... >
    </embed></object>

    Now, if flashform.swf has a "style" variable linked to a textbox, it will automatically appear

    Musicman

  5. #5
    Member
    Join Date
    Dec 2000
    Posts
    32
    Hi Musicman,

    Nope I dont want to open a html (or php) page from flash. I want to open a Flash page or movie from a HTML button that writes in a field named stylenum in the (Flash movie) a certain number (DA4377 or else). I have tried it the way you came up to and almost succeed. Here it is:

    The HTML page code:

    <DIV ALIGN="CENTER">
    <FORM ACTION="http://www.mysite.com/phptest/stylenum.php" METHOD="post">
    <INPUT TYPE="hidden" NAME="stylenum" VALUE="DA4377">
    <input name="submit" type="submit" value="Getit">
    </FORM></DIV>


    The PHP code based on what you have suggested:
    <?
    $stylenum = $_GET[stylenum]; // this line required for php 4.1 or later
    ?>
    <object>
    <param name=movie value="formBasicHTML.swf?stylenum=<?=$stylenum?>">

    <embed src="formBasicHTML.swf?stylenum=<?=$stylenum?>" width="744">
    </embed></object>


    The Flash texbox value is set to stylenum

    From here everything goes well but when the Flash file opens, there is no DA4377 appearing in the Texbox (Dynamic), And I have nothing coded as an action on my frame in the Flash file. At one point _level0.stylenum showed in the texbox...?

    Thanks!

    Daniel Victor

  6. #6
    Registered User
    Join Date
    Feb 2001
    Posts
    13,044
    Hi,

    textboxes are sometimes tricky - please make sure that the box's variable name (not instance name) is set to stylenum

    Musicman

  7. #7
    they call me the_jump... le_saut's Avatar
    Join Date
    Mar 2001
    Posts
    536
    Yes, this is one thing that gets me all the time in MX... the instance name is where the variable name was in v5.

    Aside : Appending variable names like the above (via JS or PHP or whatever) is one great way of bookmarking flash movies. Remember this when people say "Flash is bad because it can't be bookmarked".

    Try these links
    http://www.webqs.com/site/?go=folio
    http://www.webqs.com/site/?go=experiments

    Cheers
    James

    Originally posted by Musicman
    Hi,

    textboxes are sometimes tricky - please make sure that the box's variable name (not instance name) is set to stylenum

    Musicman

  8. #8
    Member
    Join Date
    Dec 2000
    Posts
    32
    Musicman U R the best! I recomposed everything and it is working just fine... except for one thing!!! When the user has sent the form, the DA4377 appearing in the stylenum box is not showing in the email message that has been returned!!!

    Any idea?

    Thanks again!

    Daniel Victor

  9. #9
    Registered User
    Join Date
    Feb 2001
    Posts
    13,044
    Hi,

    do you even mention the stylenum in your email script?
    If yes, are the other fields in the email form in the same timeline?

    Musicman

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