Jump to content

Search the Community

Showing results for '"detecting mobile device"'.

  • 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 10 results

  1. Detecting mobile device using user agent isn't the best way to check if a user is using a mobile device since user agent strings can be spoofed easily. There is a JavaScript API built-in for detecting media. The JavaScript window.matchMedia() method returns a MediaQueryList object representing the results of the specified CSS media query string. You can use this method to detect a mobile device based on the CSS media query. <script> $(document).ready(function(){ let isMobileDevice = window.matchMedia("only screen and (max-width: 760px)").matches; if(isMobileDevice){ // The viewport is less than 768 pixels wide //Conditional script here } else{ //The viewport is greater than 700 pixels wide alert("This is not a mobile device."); } }); </script> You can use above script to do show/hide elements depending on the screen size.
  2. hey guys, I'm going to write another site in PHP/MYSQL and I'm pretty sure people will be looking at it while on the go. I searched for the topic here via this: https://forums.phpfreaks.com/search/?q=detecting%20mobile%20device Do any of you experts remember any of those threads? At the moment I don't have time to search them by 1 at a time and scan the posts. can anyone point me to some good online resources that can give me some insight on how professional developers write code to detect a mobile device’s page request, and then determine its screen size so the data can be displayed in a presentable manner? I'm assuming it's out there. thanks!
  3. Couple things, first google actually has a php script that is much more advanced that what you are using to detect mobile devices and is much better at doing it than what you have. So I suggest looking at that. The header issue is because of the use of single quotes inside the header() in stead of double quotes, the vars are not being parsed as vars but rather literal text. header('Location: '.$mobileURL); //one way to do it header("Location: $mobileURL"); // other way to do it.
  4. hello every one.... Can any one plz help me how to detect mobile device brand like samsung, nokia or micromax uisng php or javascript.... Any help will be greatly appreciated.... Thank you.. :)
  5. If it is none; then why we use it in the Detect Mobile Devices
  6. PHP - $_SERVER['HTTP_ACCEPT'] If I use the above code, which part of the results will determine if it is an android phone or a mobile device?
  7. Hi I am trying to include a script that I have tested on its own (and works fine), into the index.html page of my website. I am placing it in an Aside (on the left), when I run this on my ISP test folder it does not work. It displays the code from the first row of the table to the heading in the following html code. I can't spot anything obvious, so what is causing this error. This is the code I am running: <!--<?php require_once('mobile_device_detect.php'); mobile_device_detect('http://www.1066cards4u.co.uk/index1.html','http://www.1066cards4u.co.uk/index1.html','http://www.1066cards4u.co.uk/index1.html',false,'http://www.1066cards4u.co.uk/index1.html','http://www.1066cards4u.co.uk/index1.html','http://www.1066cards4u.co.uk/index1.html','http://www.1066cards4u.co.uk/index1.html',false); ?>--> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="Description" content="Ecologic Theme"> <meta name="author" content="CoffeeCup Software, Inc."> <meta name="Copyright" content="Copyright (c) 2011 CoffeeCup, all rights reserved."> <link rel="shortcut icon" href="favicon.ico" > <link rel="icon" type="image/gif" href="animated_favicon1.gif" > <title>1066 Cards 4 U - Home</title> <link rel="stylesheet" href="stylesheets/default.css" /> <!--[if IE]> <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> </head> <body> <div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> <header> <h1><a href="index.html"> ..............</a></h1></br></br></br></br> <div><img src="images/1066Green.jpg" width="600" height="80" alt="" title="" border="0" /></div> </header> <section id= "sidebarR" class= clear> <asideR> <?php include("RelHol_connect.php"); doDB(); $get_Event_sql = "SELECT Events.ID, Events.Event_Date, Events.Event_Description, Religion.ID, Religion.Religion FROM Events LEFT JOIN Religion ON Religion.ID = Faith_ID WHERE MONTHNAME(Events.Event_Date)= MONTHNAME(Now()) ORDER BY Events.Event_Date ASC"; $get_Event_res = mysqli_query($mysqli, $get_Event_sql) or die(mysqli_error($mysqli)); //create the display string $display_block = " <table width=\"30%\" cellpadding=\"3\" cellspacing=\"1\" border=\"1\" BGCOLOR=\"#87CEEB\"> <tr> <th>Date</th> <th>Event</th> <th>Faith</th> </tr>"; while ($Event_info = mysqli_fetch_array($get_Event_res)) { $Event_Date = $Event_info['Event_Date']; $Event_text = nl2br(stripslashes($Event_info['Event_Description'])); $Faith = $Event_info['Religion']; //add to display $display_block .= " <tr> <td width=\"5%\" valign=\"top\">".$Event_Date."</td> <td width=\"30%\" valign=\"top\">".$Event_text."</td> <td width=\"15%\" valign=\"top\">".$Faith."</td> </tr>"; } //free results mysqli_free_result($get_Event_res); //close connection to MySQL mysqli_close($mysqli); //close up the table $display_block .= "</table>"; ?> <h2>Religious Holidays & Festivals</h2> <?php echo $display_block; ?> </asideR> </section> <section id= "sidebarL" class= clear> <asideL> <div class="fb-like" data-href="http://www.1066cards4u.co.uk" data-send="true" data-layout="box_count" data-width="300" data-show-faces="true" data-font="arial"></div> </asideL> </section <section id="mainContent" class="clear"> <nav> <h3>Main Menu</h3> <p><ul> <li><a href="index.html">Home</a></li> <li><a href="Links.html">Links</a></li> <li><a href="Techniques.html">Techniques</a></li> <li><a href="Verse_Menu.html">Verse's</a></li> <li><a href="contact.html">Contact Us</a></li> <li><a href="News.html">News</a></li> <li><a href="AboutUs.html">About Us</a></li> <li><a href="Gallery.html">Gallery</a></li> <li><a href="index1.html">iPad users</a></li> </ul></p> </br> <h2 style="text-decoration:blink; color: red">NEWS FLASH!</h2> <h4><font color="red">I have been working on an iPad version of the web site, which is almost ready to roll. However if you have an iPad and want to use this you can access it by clicking on the link above or in the page footer (Sometimes the main link does not work). I am trying to solve some coding problems that auto detects mobile devices, which will automatically redirect to the iPad code.</h4> <!--<h4><font color="red">NEW LOOK website!</br>Smarter looking site, but unfortunately as the Forum has not been used since the launch we have decided to remove it.</br>However if you have any ideas or suggestions please use the Feedback Form on the contact us tab.</h4>--> <h4><font color="blue">We have made many minor changes - so please see NEWS page for details (Bulletin #.</font> </h4> <h4><font color="blue"> </br>For instructions on how to use the Verse Printing Utility! SEE NEW INSTRUCTION PDF file. ( Version 2.9 - 28th November 2012)</font> </h4> <h4><font color="blue"></br>A form for adding verses has been added to the Contact Us page! </font> </h4> </nav> <section id="mainLeft"> <div><img src="images/B1012F.jpg" width="250" height="250" alt="" title="" border="0" /> </div> <br /> <h1>Welcome to our site</h1> </br> <p>We are passionate about card making and we would like to invite you to share your interests in card making with us.</br> </br> On our Website we have many interesting items on our site that we think will be of interest to you. <ul TYPE=SQUARE> <li>Some links to suppliers websites</li> <li>Many articles on card making techniques</li> <li>A unique utility which allows you to print greetings verse for your cards</li> <li>Database of nearly 1000 verses</li> <li>The ability to type in your own verse</li> <li>Videos on card-making techniques in our Gallery</li> <li>Feedback facility to allow visitors to comment on our site</li> </ul> </p> </br> <p>We hope that you will enjoy our site and you will visit us again SOON!</p> </section> <!-- end mainLeft --> </section> <!-- end mainContent --> <footer> <p>© 2011 Ecologic, Inc. All rights reserved. <a href="http://coffeecup.com">HTML Editor Theme</a> by CoffeeCup Software.</br> © 2012 Content:1066 Cards 4U. All rights reserved. </p> <ul> <li><a href="index.html">Home</a></li> <li><a href="Links.html">Links</a></li> <li><a href="Techniques.html">Techniques</a></li> <li><a href="Verse_Menu.html">Verse's</a></li> <li><a href="contact.html">Contact Us</a></li> <li><a href="News.html">News</a></li> <li><a href="AboutUs.html">About Us</a></li> <li><a href="Gallery.html">Gallery</a></li> <br /> <li><a href="index1.html">iPad users</a></li> </ul> </footer> </br> </br> </br> </br> </body> </html> The added code is in red.
  8. Hi, how can i detect if my website is being open in mobile type all devices instead of computer Please help
  9. Pm me if u stil want to knw how to detect mobile device, wil gv u d best way to detect mobile device and pc. I had been working on mobile sites fa 4 years now. Am askin u pm coz atm am not on pc so il give it to u tomorrow
  10. is PHP a good tool to detect if the user is on a mobile device and redirect to a different page?
×
×
  • 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.