Welcome, Guest
  • Author Topic: Having problem using GET with PHP.  (Read 2123 times)

    just.in

    • Server what's that
    • *
    • Posts: 3
      • ICQ Messenger - 68880605
      • MSN Messenger - gqmonkey@hotmail.com
      • View Profile
      • jcmedia
      • Email
    Having problem using GET with PHP.
    « on: 04/23/02, 03:22 »
    Im having a problem using GET for php. my code looks like this:

    on (release) {
    getURL ("javascript:popup_window('contact.php','vfscontact','menubar=no,width=287,height=264')");
    }

    I'm not sure how to incorporate GET so that i send the info to my external php file. The code i show you next does work:

    on (release) {
    getURL ("contact.php", "_blank", "GET");
    }


    But.. i can't add features to the window. Can anyone help me out? This is my first post and im hoping to get some help. Thanks !  :)

    -cubex

    BurtonRider1983

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 864
    • Rider-4-Life
      • AOL Instant Messenger - BurtonRider1983
      • View Profile
      • Flash Developer's Corner (being built)
    Re:Having problem using GET with PHP.
    « Reply #1 on: 04/23/02, 10:23 »
    calling any javascript functions from flash
    -You must put the javascript code that you want to execute in the html document's body that your flash movie is embedded in...
    -then you can just reference to the code on an event in your movie. You use the getURL command and rather then putting the URL, you put "javascript:" and then the name of your function (without spaces)...such as,
                 on (release) {
                       getURL  ("javasript:your_function();");
                   }


    Hope this gives you some help.  Lates.
                                                                         -Ian

    just.in

    • Server what's that
    • *
    • Posts: 3
      • ICQ Messenger - 68880605
      • MSN Messenger - gqmonkey@hotmail.com
      • View Profile
      • jcmedia
      • Email
    Re:Having problem using GET with PHP.
    « Reply #2 on: 04/23/02, 12:54 »
    Hey burton Rider  :)

    Well i get what your explaining, but i don't get what im supposed to do. In flash i have 3 forms "name" "email" "comment" and a send button.

    that send button in flash has a function that looks like this:

    on (release) {
    getURL ("contact.php", "_blank", "GET");
    }


    This pops up a new window that is "contact.php"... that contact  php form writes
    "thank you $name for writing me this message" and it sends all the form boxes to my email. Then the user can close the window.

    My problem is that i can't add features to the window. I've tried to change the code in flash to do

    on (release) {
    getURL ("javascript:popup_window('contact.php','vfscontact','menubar=no,width=287,height=264')");
    }

    And this works great!... except I don't know how to send using "GET" in this example.


    I've also added in my html code (the html page that contains my flash page) this :

    <SCRIPT language = "javascript">
    <!--
    function popup_window(whatURL, name, features){
    window.open(whatURL,name,features);
    }
    //-->
    </script>

    I'm not a n00b at designing, but this is just not working for me.

    - hope you can help again!

    p.s.
    i Ride a Salomon Sequence

    -cubex

    just.in

    • Server what's that
    • *
    • Posts: 3
      • ICQ Messenger - 68880605
      • MSN Messenger - gqmonkey@hotmail.com
      • View Profile
      • jcmedia
      • Email
    Re:Having problem using GET with PHP.
    « Reply #3 on: 04/23/02, 13:26 »
    oh and another thing. i tried using your tip by just writing:

    in flash

                 on (release) {
                       getURL  ("javasript:popup_window();");
                   }


    Then in my HTML

    <SCRIPT language = "javascript">
    <!--
    function popup_window(whatURL, name, features){
    window.open('contact.php','VFS','menubar=no,width=287,height=264');
    }
    //-->
    </script>

    but still, The information is not being sent to the popup window (contact.php)... GET needs to be added somewhere and thats what i dont know what to do.

    Flash-db

    • Administrator
    • Systems Administrator
    • *****
    • Posts: 1876
      • View Profile
      • Flash-db.com
    Re:Having problem using GET with PHP.
    « Reply #4 on: 04/23/02, 13:42 »
    Ok - Since the GET method is basically like attaching variables onto the end of the string - you'll have to do this a bit more manually since your using a Javascript Pop Window.


    You'll have to attach the variables to the end of the URL your opening for this to work:

    Such as:

    on (release) {
    getURL ("javascript:popup_window('contact.php?Variable1=Value1&Variable2=Value2&Variable3=Value3','vfscontact','menubar=no,width=287,height=264')");
    }


    This can get somewhat annoying if you've got a ton of variables, but it will work.

    If you want the variables to be dynamic (ie from the flash movie instead of hard coded in) - It would be something like this:


    on (release) {
    getURL ("javascript:popup_window('contact.php?Variable1="+Value1+"&Variable2="+Value2+"&Variable3="+Value3+"','vfscontact','menubar=no,width=287,height=264')");
    }
    Flash-DB

    Andrew

    • Server what's that
    • *
    • Posts: 11
    • Flash-db Rules
      • View Profile
      • Email
    Similar problem sending variables
    « Reply #5 on: 05/15/02, 09:01 »
    Hi,
    I have a similar problem.  I am trying to send some variables to a new URL, but the server doesn't allow Post, so I tryed including the variables at the end:


    GetUrl ("http://www.mywebsite.com/Sample.html?Variable1="+Value1+"&Variable2="+Value2+"&Variable3="+Value3+"'')

    But I receive in the Address Bar the Url including all variables, so obviously doesn't work.

    Basically  what I need is to send three variables, so the first frame in the Sample.html file will load the php file to fetch the data from MySQL.

    Thanks a lot in advance.

    Andrew.

    Ronald Wernecke

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 6203
      • View Profile
      • Professional Support
      • Email
    Re:Having problem using GET with PHP.
    « Reply #6 on: 07/31/02, 08:31 »
    Hi,
    this is exactly the point: If you are calling a swf-file, you have to use GET!
    Post delivers you a "ilegal function".
    8)
    happy flashing
    8)
    Ronald

    Musicman

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 2685
      • View Profile
      • Email
    Re:Having problem using GET with PHP.
    « Reply #7 on: 07/31/02, 14:53 »
    Hi,

    only if you are sending to a script, consider a form in the popup

    <script>
    function popup(var1, var2, var3)
    { win = window.open('', 'popup', 'width=400,...');
     win.document.write('<body onload="document.forms.myform.submit()">'+
    '<form name=myform method=post action="script.php"><input type=hidden name=var1 value="'+var1+'">'+
    ....
    '</form>');
     win.document.close();
    }
    Now you can call geturl("javascript:popup('"+var1+"','"+var2+"','"+var3+"')")

    Musicman