Hello there, Kind of newbie to PHP and javascript... I have this problem: I want to pass a javascript variable to a PHP code. I am inside a javascript function that is creating HTML elements dynamically. After creating a <select> tag, I want to populate it with a list of variable names from $_SESSION['subgroupcolumn'] . Here is part of the code: . . . location.href="subgroup.php?m=" + m; var linner= "for ($c=1; $c < $_SESSION['rows']; $c++){ echo( '<option value=' . $c . '>' . $_SESSION['subgroupcolumn'][$c][0] . '</option>\n' ); }" ; document.getElementById(selectedSubsetText + hitcounter).innerHTML = linner ; . . . Since we cannot pass a javascript var to PHP directly, I am redirecting to subgroup.php and sending the variable ("m") and getting it there using a $_GET. Now the question: In subgroup.php, after I get the variable m, I create the $_SESSION['subgroupcolumn'] array then I redirect to the initial page. Obviously it's not working because the code after location.href="subgroup.php?m=" + m; is not executing after coming back to the initial page.... How do I make it to continue executing the javascript code? I hope it's clear... Thanks for your help. -- View this message in context: http://www.nabble.com/PHP-Javascript-header-tp21483721p21483721.html Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php