kv79 Posted July 4, 2008 Share Posted July 4, 2008 hi all , I have some variable on the first page , I need to send that variable to the other page .send is mean , when I click on some button, that variable is sent .Or the other option is that ,I set the $POST variable on the first page .Thanks . Link to comment Share on other sites More sharing options...
Synook Posted July 4, 2008 Share Posted July 4, 2008 You could use GET <button onclick="window.location = 'page.php?var=<?php echo $var; ?>'" value="Click me" /> Or a form with POST <form action="page.php" method="post"><input type="hidden" name="var" value="<?php echo $var; ?>" /><input type="submit" value="Click me" /></form> Link to comment Share on other sites More sharing options...
kv79 Posted July 4, 2008 Author Share Posted July 4, 2008 Thanks a lot . I just used your second solution and it works great .When I use a first option I come to this problem . <button onclick = "open_win(<?php $var; ?>)" value = "click me "/> function open_win(i) {window.open("page.php?var = ", "_self" );} The problem is , that I get variable called i; and I dunno to implement into the code . Link to comment Share on other sites More sharing options...
Synook Posted July 4, 2008 Share Posted July 4, 2008 window.open("page.php?var = " + i, "_self" ); Link to comment Share on other sites More sharing options...
kv79 Posted July 4, 2008 Author Share Posted July 4, 2008 greatly thanks to you for your perfectly understanding my problem . Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.