Jump to content

Archived

This topic is now archived and is closed to further replies.

Guest kilbad

Regarding PHP variable passing

Recommended Posts

Guest kilbad
I am passing a variable in a URL called "image". This variable equals the numbers 1-7.

My problem is this, I need to take the variable's value (let's say the url is example.php?image=1 ), and use it to echo another variable, which will, in another file, specify the image's caption..

So with this example, I want to be able to take the "1" and combine it with the word "caption" to echo the variable "caption1" which will already be defined in another place.

Can anyone help me with this?

thanks in advance

Brendan


P.S. also see my post at htmlforums for more details:: http://htmlforums.com/showthread.php?t=80062

Share this post


Link to post
Share on other sites
Do something like this:
[code=php:0]$img = $_GET['image'];
echo ${'content'.$img};[/code]

Share this post


Link to post
Share on other sites
Guest kilbad
brilliant!! thank you so much!

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.