php - Related link for the device viewing -


i'm wanting add content my site same layout is.

basically, can see list of categories on home page. links list.php page content reflect title.

i'm looking same thing i'm wanting display apps.php instead of list.php same thing instead of content categorised type have them categorised device. example apps.php?id=iphone.

what wanting link on index page displayed apps.php page if using related devices.

for example

the link title "app download" displayed on iphone/ipod touch link apps.php?id=iphone, androids link apps.php?id=android , same ipad mini , ipad nothing displayed on other devices.

please can guide me on how this. thanks.

i'm guessing can done following code:

<script type="text/javascript"> var bodyclass ='desktop'; if ( (navigator.useragent.indexof('android') != -1) ) {    bodyclass = 'android'; } else if((window.navigator.useragent.match('iphone'))||(window.navigator.useragent.match('ipod'))) {   bodyclass = 'iphone'; } else if (window.navigator.useragent.match('ipad')){   bodyclass = 'ipad'; } window.onload = function(){   document.body.classname += ' '+ bodyclass; }  <script> 

and

<ul class="pageitem"><li class="button iphone"><input name="submit" value="app downloads" onclick="window.location='apps.php?id=iphone' " type="submit" /></li></ul>  <ul class="pageitem"><li class="button ipad"><input name="submit" value="app downloads" onclick="window.location='apps.php?id=ipad' " type="submit" /></li></ul>   <ul class="pageitem"><li class="button android"><input name="submit" value="app downloads" onclick="window.location='apps.php?id=android' " type="submit" /></li></ul> 

but not seem work.

update:

if have @ this picture taken on ipad see 3 app downloads buttons. top 1 links app.php?id=android middle 1 links app.php?id=iphone , bottom 1 links app.php?id=ipad. on occasion 3rd link should visible , other 2hidden viewing on ipad.

if view on ipod touch middle 1 should visible.

my code index.php page in screenshot this:

<?php  include_once('include/connection.php');  include_once('include/article.php');  $category = new category; $articles = $category->fetch_all();   ?>  <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr...nsitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>xclo.mobi</title>  <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 bodyclass ='desktop'; if ( (navigator.useragent.indexof('android') != null) ) {    bodyclass = 'android'; } else if((window.navigator.useragent.match('iphone') != null)||(window.navigator.useragent.match('ipod') != null)) {   bodyclass = 'iphone'; } else if (window.navigator.useragent.match('ipad') != null){   bodyclass = 'ipad'; } window.onload = function(){   document.body.classname += ' '+ bodyclass; }  <script>  <script type="text/javascript">  var _gaq = _gaq || []; _gaq.push(['_setaccount', 'ua-34172259-1']); _gaq.push(['_setdomainname', 'xclo.co.uk']); _gaq.push(['_trackpageview']);  (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); })();  </script>  </head> <body>  <?php include_once('header.php'); ?>   <div id="content">  <ul class="pageitem"><li class="button android"><input name="submit" value="app downloads" onclick="window.location='apps.php?id=android' " type="submit" /></li></ul>  <ul class="pageitem"><li class="button iphone"><input name="submit" value="app downloads" onclick="window.location='apps.php?id=iphone' " type="submit" /></li></ul>  <ul class="pageitem"><li class="button ipad"><input name="submit" value="app downloads" onclick="window.location='apps.php?id=ipad' " type="submit" /></li></ul>   <?php foreach ($articles $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']; ?>"/> </a></li></ul> <?php } ?>     </div> <br><center> <script charset="utf-8" type="text/javascript" src="http://ws-eu.amazon-...d9-6cf16307e855"> </script> <noscript><a href="http://ws-eu.amazon-...t">amazon.co.uk widgets</a></noscript></center>  <?php include_once('footer.php'); ?>   </body> </html> 

any ideas on how work please. thank you.

i have figured out.

by using code:

>      <?php $ua=$_server['http_user_agent']; switch(true) {   case >       stripos($ua,'android') : >        $device = 'android'; break;   case stripos($ua,'ipad') : >         $device = 'ipad'; break;   case stripos($ua,'iphone') : >         $device = 'iphone'; break; } ?>   >  > <ul class="pageitem"><li class="button android"><input name="submit" > value="app downloads" onclick="window.location='apps.php?id=<?php echo > $device; ?>' " >          type="submit" /></li></ul> 

thank you. please 1up.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -