Printing flash vars if php

havng a real stupid problem. i am trying to simply print a flash var on a php page.

I have a flash var called “news” and here is the code on the submit button

[AS]
on(release){
getURL(“http://www.digitalosophy.com/news/maillist.php”);
}
[/AS]

my php code is this:


<?
	$news = 'news';
	print "Your name is ". $news . ".";

?>


please someone, anyone tell me what I am doing wrong.

what is that outputting? it should be reading out

Your name is news.

You are defining the variable $news and the string ‘news’ so you are overriding any value you gave it in the Flash movie.

What you want to do is define the method of posting the variables for the Flash movie:


on(release){
getURL("somepage.php", "POST");
}

then the PHP would look like this:


<?
$news = $_POST['news'];
print "Your name is " . $news . ".";
?>

the $_POST grabs the variable from the Flash script and defines it as a PHP variable.

http://www.kirupaforum.com/forums/showthread.php?s=&threadid=17604

I already showed you that thread, but read over it again. Try downloading the source and seeing how its set up. :slight_smile: