Dynamic vars
Posted: Mon Jun 05, 2006 4:13 am
How can i create dynamic vars in php?
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
You'll have to tell us what $var contains (integer, string...)aetoc wrote:Sorry.
I'm sending n vars from page1 to page2.
I want to use this vars in page2.
Ex.
$var1
$var2
$var3
...
So we're talking about passing $test (string) from page a to page b so that it can be printed out.aetoc wrote:Strings. I'm looking somthing like....
while (...)
{
echo $test.$counter;
$counter++;
}
P.S. Are you from Greece?
Code: Select all
echo "<a href="page2.php?test=".$test."">page2</a>"; //for page 1Code: Select all
$test = $_GET['test']; // for page 2Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
No. I wont to pass 1 to n vars from page a to page b.
The pass is going like this....Code: Select all
while (($file2 = readdir($open_folder)) !== false)
{
if ($file2 != "." AND $file2 != ".." AND $file2 != "Thumbs.db")
{
if ($_POST['change'.$file_id] == "on")
{
$url .= "&files".$file_to."=".$file_id;
$to_used[$file_to] = $file2;
$file_to++;
}
$file_id++;
}
}Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]