Page 1 of 1

Use WURFL Output in PHP

Posted: Sun Feb 18, 2018 2:00 pm
by qrahaman
Hello,

I created a WordPress plugin where I have successfully registered, enqueued and localized the script to send the WURFL data to my js script. That isn't the issue. I would like to use the WURFL output, specifically, the screen dimensions to execute login redirects within PHP. Is there a way of just outputting the WURFL data where I can directly use it in PHP? If so, how?

Re: Use WURFL Output in PHP

Posted: Mon Feb 19, 2018 1:24 pm
by aaronp
Hi Quint,

As mentioned in our separate thread, if you'd like to use WURFL inside your PHP script, it seems like WURFL Cloud for PHP would be most optimal for your needs.

However, to answer your question, you may reload your page using the following code sample with the resolution_width provided by WURFL.

window.location.href=”wurflexample.php?screensize="+WURFL.resolution_width;

Also, do note that you can do page redirects from within JS without the use of PHP. The following tutorial:

https://www.sitepoint.com/device-detect ... -wurfl-js/

is an example of how to use WURFL.js to multi-serve different stylesheets to mobile/non-mobile devices.

Hope this helps. Please do not hesitate to reach out to us at support@scientiamobile.com for any questions or concerns.

Thanks,

Aaron

Re: Use WURFL Output in PHP

Posted: Fri Apr 20, 2018 3:38 pm
by qrahaman
Thanks, Aaron. This helps.