get url and send variable
I have a button in my flash movie and this code
on(click){
getUrl("redirect.php","_self")
}
but I also want to send a variable let's say "submit" to this page
if my variable will be "0" the script will do something
if it will be "1" ....
if I want to send a varaible to a php script I do this way
newEntry = new LoadVars()
newEntry.ref = this
newEntry.submit = "0"
newEntry.sendAndLoad("redirect.php?, newEntry , "POST");
but how can I lunch a php page and also send a variable to this page
Senior Member
on(release){
getURL("redirect.php","_blank","POST")
}
...wil send all variables in the current timeline.
I tried but it didnt worked
this is the php page
<?php
$submit = $_POST['submit'];
if ($submit == '0){
commands........
exit;
?>
and flash script
on(click){
newEntry = new LoadVars()
newEntry.ref = this
newEntry.submit = "0"
getURL("redirect.php", "_blank" , "POST");
}
I have a page with my flash movie and when I press the button I want a
new page redirect.php to open but also to send this variable to the page
I dont understand why it didnt work
Senior Member
Why do you write on(click) ... had no idea there is such a command ( sounds like Swisch or something ).
In php should be, quotes....
if ($submit == '0')
Im not good with php, but from other scripts Ive seen you compare with a single = character.
yes this is corect $submit == '0',I made a mistake only when I wrote on forum in my script it is exactly like this: $submit == '0'
I use the button component and this is why I use on(click) in flash mx 2004
this is not the problem I used it in ather scripts and examples that work fine
Senior Member
Then Im out of suggestions.
can you give pls an example where you used getURL to send a variable
to a php page and it worked?
Senior Member
I have only used....
this.loadVariables("write.php","POST");
...that sends all variables in the current timeline to the script. ( in my case a script that writes all variables sent, to a textfile ).
Last in the php script I usually have....
echo "state=done&";
.....to tell that Flash the variables are saved.
new issue or the same?
i need to send one variable from my main time line to an email.
i thought i'd use...
__________
"mailto:chriswilshaw@hotmail.com" [_blank ["disporder"]]
__________
...in the get url area as an expression
and set the send vars to "get"
"disporder" is the only variable i care to recieve on email. there are 10's of variables in the timeline i dont want.
do i have to send the variable to a new time line and send the email from that timeline
seems too much of a work arround - can someone help? please
Senior Member
You will need a mailscript to send mails from Flash. With the mailto you would only open the users default email program with a option to put in the subject and part of the body.
Heres a tutorial on sending mails from Flash.
http://www.flashkit.com/tutorials/Dy...-658/index.php
still not there...
this is a stripped version of my fla if anyone would like to look
ps it doesnt work, yet...
can it?
Attached Files
sorry piano,
must have replied at same time, i will look at your help, thanks
repeat
head, wall, bang,
until done
pele, i think i would be fine if i could just cause the users email package to open and put my varable contents into either the subject or body
ive done someting (in the past but havent got the file) and it allowed you to put something like "&subject" after the email address.
am i barking up the right tree? or wrong forest altogether?
Senior Member
heres an example.
code: someVariable="JOHN";
getURL("mailto:info@pelepiano.com?subject="+someVa riable+"..is the best!&body=HI!");
you are great, thanks.
Code:
on (release) {
getURL("mailto:chriswilshaw@hotmail.com?subject="+ordernum+"&body=+disporder+", thanks);
}
i tried this and got "+disporder+" back in my email (varable name not contents)
any ideas
ok i spotted the problem with the " in the wrong place and have a new, not working fla attached
Attached Files
just to clear things up, i wasnt accusing your code of not working
ive sorted it now, the above attachment does work, my server hadnt updated my change when i tested. - i think im ok now!
thanks!!
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width