This topic is locked

Redirect a page with $values on button click

3/27/2011 8:05:38 PM
PHPRunner General questions
A
agentsmith author

From the manual, you can redirect using Server event with this code
Example 4
To make a button redirect to another page, add the following code to the OnBefore event (Client Before tab) or OnAfter event (Client After tab):

location.href="http://cnn.com";;


Is there any example on how to redirect to a page with specific id, ie. user_edit.php?phoneID=$_REQUEST["masterkey1"]?
Thanks.

Sergey Kornilov admin 3/28/2011

It depends on how you want to retrieve this ID. Since Javasctipt code doesn't have access to PHP variables there is no generic solution.
You need to explain where exactly (which page) you need to add this button and where this link needs to point.
Another thing - if you only need to display a link use 'Insert PHP code snippet' function:

echo "<a href='user_edit.php?phoneID=" . $_REQUEST["masterkey1"] . "'>Proceed to user page</a>";