sushantkaura Posted November 15, 2007 Share Posted November 15, 2007 hey guys , i have a lil problem . i have 2 php pages in which value has to be passed between the two the function open_win() is used to open the page in a new window and is defined above the code as it is a java script . a.php ................ function open_win() { window.open("player.php?songId=<?=$songid?>") } $songid=$row['Cid']; echo "<td>"?><input type=button value="Listen" onClick="open_win()"/><?php "</td>"; ....................... second page player.php i m typing ....................... $sid=$_GET["songId"]; echo "$sid"; ....................... i have done like this but in player.php it is not echoing the value and not even in the url of the next window, is it the rite way to id ? i think i m doing something wrong . plz tell me the rite way to do it. sushant Link to comment https://forums.phpfreaks.com/topic/77505-solved-passing-values-through-url/ Share on other sites More sharing options...
pocobueno1388 Posted November 15, 2007 Share Posted November 15, 2007 Change your function to this function open_win(songID) { window.open("player.php?songId="+ songID) } Now to call the function, do this <?php $songid=$row['Cid']; echo "<td><input type=button value='Listen' onClick='open_win($songid)'/></td>"; ?> Link to comment https://forums.phpfreaks.com/topic/77505-solved-passing-values-through-url/#findComment-392317 Share on other sites More sharing options...
sushantkaura Posted November 15, 2007 Author Share Posted November 15, 2007 thnx , it wrks .. Link to comment https://forums.phpfreaks.com/topic/77505-solved-passing-values-through-url/#findComment-392321 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.