Jump to content

Search the Community

Showing results for tags 'mobile detection'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. I need a tiny shove in the right direction on how to implement this prewritten mobile detection script. It comes up #1 on Google but it has no instructions. Could anybody help me with this? http://mobiledetect.net/ Q1) I believe this code needs to be placed at the top of every HTML file on my site. But where in the HTML file do I place it? When I put it at the very top of my index.htm it doesn't run. The code prints out like plain text at the top of the webpage. <?php require_once 'Mobile_Detect.php'; $detect = new Mobile_Detect; // change the mobile url here (between the quotes) $mobileurl = "http://m.mywebsite.com"; $deviceType = ($detect->isMobile() ? ($detect->isTablet() ? 'tablet' : 'phone') : 'computer'); if( $detect->isMobile()){ header("Location: " . $mobileurl,true, 301); /* Redirect browser */ /* Make sure that code below does not get executed when we redirect. */ exit; } ?> Q2) Mobile_Detect.php I believe I need to upload this file to my root directory. That's easy enough but does it need special permissions or something else? Right now permissions are set to 0644 on this file. Q3) Do I need to update my .htaccess file which is blank? I'm hosting with GoDaddy so I believe it's on an Apache server. Q4) Is there any other obvious thing that I'm missing? Thanks a ton in advance!!!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.