Use WURFL Output in PHP

Questions about the WURFL Cloud service.
qrahaman
Posts: 9
Joined: Mon Jul 18, 2016 10:31 am

Use WURFL Output in PHP

Postby qrahaman » Sun Feb 18, 2018 2:00 pm

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?

aaronp
Posts: 242
Joined: Wed Dec 09, 2015 12:39 pm

Re: Use WURFL Output in PHP

Postby aaronp » Mon Feb 19, 2018 1:24 pm

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

qrahaman
Posts: 9
Joined: Mon Jul 18, 2016 10:31 am

Re: Use WURFL Output in PHP

Postby qrahaman » Fri Apr 20, 2018 3:38 pm

Thanks, Aaron. This helps.


Who is online

Users browsing this forum: No registered users and 2 guests