Hello,
I just noticed this:
I have created an application in phprunner wich, redirects the user to the "Add license" screen if he or she have not entered a license number. the redirect works great when I try the application using the web browser, but it doesn't work when tested using it as a desktop app (the desktop app was created using PHPrunner's "Create desktop app" option.
I would love it if anyone can give me any advice on this. And just for consistency, I used redirect the code from the predefined code that phprunner let's you add to the events.
`//********** Redirect to another page ************
header("Location: anypage.php");
exit();`
I did add some of my own, but just to check if a record exists, again, this code works well while using a web browser, but not when used as a phprunner desktop app, could it be the php version used in the generated desktop app?
The full code I'm using in the login page's Before display event is as follows, also, I am including both screen shots, the one from the browser test and the one from the desktop app test:
`
//** Check if specific record exists ****
$rs = DB::Query("select * from nothereugmembers where GroupID='1'");
$data=$rs->fetchAssoc();
if($data)
{
// if record exists do something
$pageObject->hideItem("loginform_register_link");
}
else
{
echo "## Solo el primer usuario registrado sera Administrador";
// if dont exist do something else
};
// code from business-template Security for Desktop Apps
$rs = DB::Query("select * from lickemup where activa = 1");
$data=$rs->fetchAssoc();
if($data)
{
// if record exists do something
}
else
{
// if dont exist do something else
//----- CHECK OFLINE LICENSE
$rs = DB::Query("select * from lickemup");
$data=$rs->fetchAssoc();
if($data)
{
// if record exists do something
//--- CHECĶ EXPIRY
$rs = DB::Query("select * from lickemup where expira > date('now') and activa is null");
$data=$rs->fetchAssoc();
if($data)
{
// if record exists do something
$date1=date_create(now());
$date2=date_create($data["expira"]);
$diff=date_diff($date1,$date2);
echo "## La licencia se tiene que activar antes de ".$diff->format("%a dias")."\n";
echo "## Click aqui is le gustaria acivarla: <a href='lickemup_edit.php'>Activar licencia!</a> ";
}
else
{
// if dont exist do something else
echo "## YA EXPIRO";
header("Location: lickemup_edit.php");
exit();
}
//--- CHECĶ EXPIRY
}
else
{
// if dont exist do something else
echo "## NO LICENSE";
header("Location: lickemup_add.php");
exit();
}
//----- CHECK OFLINE LICENSE
}
//** Redirect to another page ****
header("Location: anypage.php");
exit();
// end Security for Desktop Apps code
`