On my main page, I have a list of item ID's which are assigned variables, the list is concatenated and so the variables are always different.

So another thing that gets concatenated is a link, which uses javascript/jquery to open a popout modal window which is another php file called sharepost.php. I want to be able to transfer the php variables from the main page to append them on the end of the sharepost.php URL so I can use $_GET to grab them for use.

Here's what I have... not working, but I figured I'd give it a try.

<?php

//use mysql to loop through some variables
$post_id = $setvalue;
$member_id = $anothersetvalue;


$list .= '
[INDENT]<div>
   ' . $post_id . '
</div>

<div>
   ' . $member_id . '
</div>

<div>
   <a href="#" class="button" onClick="openup(); return false">Share This Post</a>
</div> 

$the_link = " http://sharepost.php?post_id=' . $post_id . '&member_id=' . $member_id . ' ";
[/INDENT]
';

?>

<HTML>
<head>
<script>
// Displays an external page using an iframe
function openup(){
var src = "<?php echo $the_link;?>";
$.modal('<iframe src="' + src + '" height="450" width="830" style="border:0">', {
	closeHTML:"",
	containerCss:{
		height:150,
		padding:0,
		width:350
	},
	overlayClose:true,
});
}
</script>
</head>
<body>
[INDENT]<?php echo $list;?>[/INDENT]
</body>
</HTML>

    Everything is working fine EXCEPT- the variables ($post_id and $member_id) in the generated URL, are only getting the LAST value of the mysql query....

    Even though the echoed variables in the $list, are getting the correct concatenated values.

      Your post is kind of confusing. You mention a list of id's but there are no loops to process a list of id's. additionally, your first reference to $list is a concatenation operation (.=) rather than assignment (=).

        Write a Reply...