This topic is locked

Button redirect

8/15/2017 4:24:57 PM
PHPRunner General questions
S
salim author

I have inserted a button in the Add page and on Client Before Tab, insered this code which is working fine.

header("Location: aaa_list.php?orderby=dlog_date");
But I want some conditions i.e
if userid=1

header("Location: aaa_list.php?orderby=dlog_date");

else

header("Location: bbb_list.php?orderby=dlog_date");
How do I put in these conditions on Buttons Event.
Thanks in advance

Sergey Kornilov admin 8/15/2017

You need to use Javascript redirect. See example #4 at https://xlinesoft.com/phprunner/docs/inserting_button.htm

S
salim author 8/15/2017



You need to use Javascript redirect. See example #4 at https://xlinesoft.com/phprunner/docs/inserting_button.htm



But how do I put in the if condition, an example would be appreciated.
Thanks

L
Lawrence Nyaga 8/16/2017

Example
on the button 'server side' you could use
//https://xlinesoft.com/phprunner/docs/index.htm?phprunner_session_variables.htm



$SampleUserInfo = Security::currentUserData();

$result["txt"] = $SampleUserInfo["User_id"];


[size="2"]then on client After[/size]

//https://xlinesoft.com/phprunner/docs/inserting_button.htm ( example 6)



if (result["txt"] == 1) {

location.href="aaa_list.php?orderby=dlog_date";

} else {

location.href="bbb_list.php?orderby=dlog_date";

}


mbintex 8/16/2017

Version 9.9 ?
Anything new I don´t know about?