Jump to content

Recommended Posts

Well I have a swf file. I'm trying to send POST variables from the flash movie to a page and I want that page to open up in a new window.

I'm trying to do a test first just to find out how it works.

Actionscript:

on(press){
send_lv = new LoadVars(); 
send_lv.say = "asdadsads";
send_lv.send("http://pn-network.net/rectanle.php","_BLANK","POST");
}

PHP:

<?
echo $_POST['say'];
?>

Now everything works fine except the variables are being sent as GET and not POST.

So when I click on the button the window that opens up is "http://pn-network.net/rectanle.php?say=asdadsads".

I don't want the variables to appear in the URL I want them to be passed using the POST method. I've been trying for two days.

I've tried getURL and everything I could find but no luck.

Any help is greatly appreciated, thanks.

Link to comment
https://forums.phpfreaks.com/topic/71872-flashphpsending-post-variables/
Share on other sites

I have an alternative for you. Basicly you want a clean URL so you could use javascript to achieve this. Flash is able to call a javascript function within that page.

Here is what you can do.

 

in your swf file

getURL("javascript:setVar('some value inserted from flash')");

 

on you parent page with flash(call the function setVar in flash)

<script>
var parentVar;

//cal this function from flash
function setVar(value){
parentVar=value;
}

</script>

 

your _blank page

<script>
var parentVar=window.opener.parentVar;
document.write(parentVar);
</script>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.