|  | Sending variables to PHP - newb question |  | |
| | | +mrcakey |  |
| Posted: Tue Jul 01, 2008 5:59 am Post subject: Sending variables to PHP - newb question |  |
Could anyone give me some quick pointers. I've been scouring the net but I can't seem to get a handle on it and Adobe's help file is useless as far as I can tell.
I just want to have a button that opens a URL and sends that URL a single POST variable.
I'm using AS2 and I get the idea I should be using LoadVars or LoadVariables, but the online help seems to be all about doing AJAX type things with sending and receiving data.
Any help greatly appreciated.
-- +mrcakey |
| |
| | | +mrcakey |  |
| Posted: Tue Jul 01, 2008 6:48 am Post subject: Re: Sending variables to PHP - newb question |  |
| |  | |
"+mrcakey" <webmaster@listyblue.com> wrote in message news:g4co5a$c8s$1@news.albasani.net...
| Quote: | Could anyone give me some quick pointers. I've been scouring the net but I can't seem to get a handle on it and Adobe's help file is useless as far as I can tell.
I just want to have a button that opens a URL and sends that URL a single POST variable.
I'm using AS2 and I get the idea I should be using LoadVars or LoadVariables, but the online help seems to be all about doing AJAX type things with sending and receiving data.
Any help greatly appreciated.
This is where I'm up to so far (code attached to button): |
on(release){ variables = new LoadVars(); variables.outro = 7; variables.send("index.php", "_self", "POST"); }
I want to be able to use $_POST['outro'] in PHP. It's not there. Interestingly on the receiving page, it seems the request method is GET rather than POST which would indicate that something is very wrong, although the movie does actually navigate to the new page so something's happening. I so wish I'd practised a while before I tried to do this for my client.
+mrcakey |
| |
| | | FutureShock |  |
| Posted: Tue Jul 01, 2008 11:54 am Post subject: Re: Sending variables to PHP - newb question |  |
| |  | |
+mrcakey wrote:
| Quote: | "+mrcakey" <webmaster@listyblue.com> wrote in message news:g4co5a$c8s$1@news.albasani.net... Could anyone give me some quick pointers. I've been scouring the net but I can't seem to get a handle on it and Adobe's help file is useless as far as I can tell.
I just want to have a button that opens a URL and sends that URL a single POST variable.
I'm using AS2 and I get the idea I should be using LoadVars or LoadVariables, but the online help seems to be all about doing AJAX type things with sending and receiving data.
Any help greatly appreciated.
This is where I'm up to so far (code attached to button):
on(release){ variables = new LoadVars(); variables.outro = 7; variables.send("index.php", "_self", "POST"); }
I want to be able to use $_POST['outro'] in PHP. It's not there. Interestingly on the receiving page, it seems the request method is GET rather than POST which would indicate that something is very wrong, although the movie does actually navigate to the new page so something's happening. I so wish I'd practised a while before I tried to do this for my client.
+mrcakey
Well you seem to have the code right. |
But just to make sure you are indeed setting the LoadVars put a trace in there and 'test movie'.
after your variables.outro = 7; trace("variables.outro = "+variables.outro); (Comment out the send method.) //variables.send("index.php", "_self", "POST");
Once you know that your LoadVars is getting set then we can move to the PHP.
Then in your PHP code to view all your $_POST use
print_r($_POST);
to see what is getting posted to the page.
Just some suggestions, you may have already tried this.
Good Luck
Scotty |
| |
| | | +mrcakey |  |
| Posted: Wed Jul 02, 2008 11:32 am Post subject: Re: Sending variables to PHP - newb question |  |
| |  | |
"FutureShock" <futureshock@att.net> wrote in message news:hGqak.11823$N87.11282@nlpi068.nbdc.sbc.com...
| Quote: | +mrcakey wrote: "+mrcakey" <webmaster@listyblue.com> wrote in message news:g4co5a$c8s$1@news.albasani.net... Could anyone give me some quick pointers. I've been scouring the net but I can't seem to get a handle on it and Adobe's help file is useless as far as I can tell.
I just want to have a button that opens a URL and sends that URL a single POST variable.
I'm using AS2 and I get the idea I should be using LoadVars or LoadVariables, but the online help seems to be all about doing AJAX type things with sending and receiving data.
Any help greatly appreciated.
This is where I'm up to so far (code attached to button):
on(release){ variables = new LoadVars(); variables.outro = 7; variables.send("index.php", "_self", "POST"); }
I want to be able to use $_POST['outro'] in PHP. It's not there. Interestingly on the receiving page, it seems the request method is GET rather than POST which would indicate that something is very wrong, although the movie does actually navigate to the new page so something's happening. I so wish I'd practised a while before I tried to do this for my client.
+mrcakey Well you seem to have the code right. But just to make sure you are indeed setting the LoadVars put a trace in there and 'test movie'.
after your variables.outro = 7; trace("variables.outro = "+variables.outro); (Comment out the send method.) //variables.send("index.php", "_self", "POST");
Once you know that your LoadVars is getting set then we can move to the PHP.
Then in your PHP code to view all your $_POST use
print_r($_POST);
to see what is getting posted to the page.
Just some suggestions, you may have already tried this.
Good Luck
Scotty
|
Thanks for looking.
It's one of those face in hands and apologies for bothering the group moments - I'd changed one instance of the button but then tested another instance which still had one of my previous failed attempts at AS attached to it.
I have a different, non-AS issue now, which I'll bother the Flash NG with, but just in case anyone here knows.
This site (www.c2recruitment.com) and my own site (www.dreamberry.co.uk) both feature several pages with the same Flash object. In IE6/7 there's a seamless transition between pages, but in Firefox there's a flicker before the object is put in place. Is there any way round that?
+mrcakey |
| |
|
|