# getURL to a PHP-page with a variable

**URL:** <https://forum.kirupa.com/t/geturl-to-a-php-page-with-a-variable/90874>\
**Category:** programming\
**Created:** [May 21, 2005, 5:35pm UTC](https://forum.kirupa.com/t/geturl-to-a-php-page-with-a-variable/90874 "2005-05-21T17:35:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![LapisInfernalis](https://avatars.discourse-cdn.com/v4/letter/l/e79b87/32.png) [@LapisInfernalis](https://forum.kirupa.com/u/LapisInfernalis)\
**Post date:** [May 21, 2005, 5:35pm UTC](https://forum.kirupa.com/t/geturl-to-a-php-page-with-a-variable/90874/1 "2005-05-21T17:35:01Z")

</div>

Hi there!

I have a problem which makes me want to bite into my keyboard… I made a button in flash mx, which should load a php-page on(release).

So far, so god. Realising the link is quite easy using getURL. But the problem is, that I need to add a variable to the link as a GET-parameter. Adding this paramter is very easy. What makes me going nuts is, that the value of this paramter should be a flash variable.

Well, I hope you get what I am talking about… 😉

Some background-information: The site I am working on at the moment is some kind of poem collection. The poem is loaded from a database according to the id given in a GET-parameter.

Now I have two little handy buttons which should let you navigate through these poems as you would read them within a book: one “previous poem”- and one “next poem”-button.

The calculation, which poem is the previous or the next one is done in php. Each button receives its variable by a paramter added to the URL of the swf-file.

This works fine. I can use the variable and show it in a dynamic textfield. This shows, that the variable makes its way into the flash-file, but how can I add it to the URL in getURL?

Let’s say this variable is called “var\_1” and its value is “5”. If I try it like this:

```auto
on(release)
{
getURL("page.php?my_var=var_1", "", "GET");
}

```

the page is loaded, but the GET-paramter is “.php?my\_var=var\_1” instead of “.php?my\_var=5” as I want it to be?

What am I doing wrong?

Many thanks for your help in advance!

LapisInfernalis
