A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Passing variables to cgi in pop window

  1. #1
    Junior Member
    Join Date
    Oct 2000
    Posts
    17
    Hi all,

    I have a number of Flash text boxes for inputting "location" etc. When I use

    getURL ("http://localhost/cgi-bin/my.cgi", "", "POST");

    as the button action everything works fine - the variables are passed to the cgi.

    However when I use:

    getURL ("javascript:launchwin('http://localhost/cgi-bin/my.cgi','','')", "", "POST");

    the pop-up window opens and the cgi is called but the variables don't get passed.

    Can anyone help please.

    Phil




  2. #2
    Senior Member
    Join Date
    Aug 2000
    Posts
    266
    I know two ways:

    1) If amount and length of variables to send is not very big, you can obviously include them into url of the script, for example,
    getURL ("javascript:launchwin('http://localhost/cgi-bin/my.cgi?var1=val1&var2=val2...','','')", "");

    2)Your script's output can contain javascript which opens new window with exact sises, then writes all necessary content using document.write() function and closes itself. You need to perform call like
    getURL ("http://localhost/cgi-bin/my.cgi", "_blank", "POST");
    to use this approach.

  3. #3
    Junior Member
    Join Date
    Oct 2000
    Posts
    17
    Kost many thanks for your help.

    The first method uses Get doesn't it? - when I use Get with a pop-upwindow it causes a javascript error.

    I'm new to this - one of my text boxes is "Location", what exactly would I put in the url for the button action to send the Location which people input as a variable.

    Another newbie question - can a window resize itself once opened?

    Best wishes,
    Phil



  4. #4
    Senior Member
    Join Date
    Aug 2000
    Posts
    266
    You do not need to specify method -- you need to select "Don't send", including variables manually assumes GET method.

    Example of sending variables "Location" and "Address":

    getURL ("javascript:launchwin('http://localhost/cgi-bin/my.cgi?Location="+escape(Location)+"&Address="+esc ape(Address)+"','','')");

    You can copy and paste it into your Flash movie in expert mode.


    Window can move and resize itself any time using resizeTo and moveTo javascript functions.

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