Jump to content

about transfer on other page


kv79

Recommended Posts

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

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

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

window.open("page.php?var = " + i, "_self" );

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...