# Printing flash vars if php

**URL:** <https://forum.kirupa.com/t/printing-flash-vars-if-php/23821>\
**Category:** Uncategorized\
**Created:** [June 22, 2003, 7:26pm UTC](https://forum.kirupa.com/t/printing-flash-vars-if-php/23821 "2003-06-22T19:26:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 22, 2003, 7:26pm UTC](https://forum.kirupa.com/t/printing-flash-vars-if-php/23821/1 "2003-06-22T19:26:45Z")

</div>

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](http://www.digitalosophy.com/news/maillist.php)”);  
}  
[/AS]

my php code is this:

```php

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

?>

```

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 22, 2003, 8:23pm UTC](https://forum.kirupa.com/t/printing-flash-vars-if-php/23821/2 "2003-06-22T20:23:47Z")

</div>

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:

```auto

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

```

then the PHP would look like this:

```php

<?
$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](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. 🙂
