Jump to content

Displaying accurate results for mobile devices.


Recommended Posts

Hi all.


I'm building a site (which you will be able to find here: http://www.xclo.mobi/xclo2) and have a list of categories on this site.


Each category on that page is linked to an item In my Database. Which then displays more content once clicked.


I have a separate database form within the same database called apps (instead of mobi). Inside this I have a list of apps available but some apps are for selected devices.


For example some apps link to google play and can only be displayed on an android device as displaying these on another device (ios for example) can be seen as pointless.


The same goes for displaying iPad apps on an iPhone and also on an android as these can be seen as pointless.


The device is saved in my apps database under the field "device" and have one of these categories iPhone iPad or android,


What I would like is to display a category on my index page along side my other ones which say "APP DOWNLOADS". And once clicked it only displays the relevant apps available just like my current promotions on my site.


But I only want the link to appear if they are on one of these devices: iPod touch, iPhone, iPad mini, iPad, android as these are the only devices that I have content for at the moment. For example. If you are viewing on a blackberry or a windows 8 or even a Firefox phone then this category will not show up.


Please can someone tell me how to do this?


Thank you.


My code for my index page is:






$category = new category;

$articles = $category->fetch_all();





<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">




<link type="text/css" rel="stylesheet" href="other.css" />

<link rel="apple-touch-icon" href="homescreen.png" />

<link href="startup.png" rel="apple-touch-startup-image" />



<script type="text/javascript">


var _gaq = _gaq || [];

_gaq.push(['_setAccount', 'UA-34172259-1']);

_gaq.push(['_setDomainName', 'xclo.co.uk']);



(function() {

var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;

ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';

var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);








<?php include_once('header.php'); ?>



<div id="content">


<?php foreach ($articles as $article) { ?>


<ul class="pageitem"><li class="button">

<a href="list.php?id=<?php echo $article['promo_cat']; ?>">

<input type="submit" name="Submit" value="<?php echo $article['promo_cat']; ?>"/>


<?php } ?>




<SCRIPT charset="utf-8" type="text/javascript" src="http://ws-eu.amazon-adsystem.com/widgets/q?rt=tf_sw&ServiceVersion=20070822&MarketPlace=GB&ID=V20070822%2FGB%2Fxclo-21%2F8002%2Fc2cd2f40-ca29-49bc-add9-6cf16307e855"> </SCRIPT> <NOSCRIPT><A HREF="http://ws-eu.amazon-adsystem.com/widgets/q?rt=tf_sw&ServiceVersion=20070822&MarketPlace=GB&ID=V20070822%2FGB%2Fxclo-21%2F8002%2Fc2cd2f40-ca29-49bc-add9-6cf16307e855&Operation=NoScript">Amazon.co.uk Widgets</A></NOSCRIPT></center>


<?php include_once('footer.php'); ?>






Please help. Thank you.

Edited by KevHopwood
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • 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.