On Wed, 13 Aug 2003 16:03:43 +0530, you wrote: >Thanks for the message. Actually I tried only html files in the beginning. >Let me explain my problem. > >I want to open a new window in a link with a function as >function newwindow() >{ > window.open("/home.php?userid=user1","Homepage"); >}
This is Javascript, right? This is a PHP list. >when I click the link > > now the address bar has the following address > >http://localhost/home.php?userid=user1 > >How can I remove the "?userid=user1" in the address bar. If you're passing that kind of data back and forth to the client I strongly advise you to use sessions instead, as your current scripts have some fairly major security holes that changing from GET to POST won't fix. http://uk2.php.net/manual/en/ref.session.php >I used method = POST for a button to go to new page. That worked well. So >with a link how can I achieve this. But to answer your immediate question, this seems to be a Javascript thing (or just use an image instead of a button). I would create a hidden form in the page and hook an onClick() event onto a link which performs the form submit. <? if (isset ($userid)) { echo ($userid); } ?> <script language="JavaScript"> function newPage() { document.getElementById("userForm").target = "_blank"; document.getElementById("userForm").submit(); } </script> <form method="post" action="<? echo ($PHP_SELF); ?>" id="userForm"> <input type="hidden" name="userid" value="user1"> </form> <a href="#" onClick="javascript:newPage()">click me</a> If you want any more information on this, I think you've reached the point where you should be asking on a Javascript list. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php