This topic is locked

Dynamic landing page

11/30/2019 8:16:26 PM
PHPRunner General questions
M
Mark Kramer author

I'm trying to get the program to go to an "add" page after login when the device is mobile otherwise when it is desktop, it should go to the main menu. I understand this is done in "After sucessfull login" event but I'm not sure how to redirect base on device.. This has been a thorn for sometime and will solve a bunch of other issues I'm working on.. A direction or insperation would be greatly appreciated.. Thank you !

Sergey Kornilov admin 12/1/2019

The problem is that you cannot get screen width in PHP. You will have to find it in Javascript, pass it to PHP, save in the session variable and then use that session variable in your AfterSuccessfulLogin event. Normal any device with a screen size of less than 768 pixels is considered a mobile device.
Here are some pointers for you:

https://stackoverflow.com/questions/1504459/getting-the-screen-resolution-using-php

M
Mark Kramer author 12/1/2019



The problem is that you cannot get screen width in PHP. You will have to find it in Javascript, pass it to PHP, save in the session variable and then use that session variable in your AfterSuccessfulLogin event. Normal any device with a screen size of less than 768 pixels is considered a mobile device.
Here are some pointers for you:

https://stackoverflow.com/questions/1504459/getting-the-screen-resolution-using-php


Thank you Sergey

D
david22585 12/1/2019

Just an idea, could you have a blank page that it redirects to after login with the Java that will redirect to the page you need? You could even build the blank page in PHPRunner on the HTML editor section.

M
Mark Kramer author 12/3/2019



Just an idea, could you have a blank page that it redirects to after login with the Java that will redirect to the page you need? You could even build the blank page in PHPRunner on the HTML editor section.


Not sure I follow.... Are you saying after logon it goes to a page that has jscript running to determine screen width? That is kind of what the AfterSuccessfulLogin event is doing..isnt it?