Page 1 of 1

iPhone

Posted: Tue Nov 08, 2011 12:21 pm
by ebgames56
I have this site i made and want it to show up nicley on the iPhone but it shows up the same as it would on the Coomputer. I just want it to what i have in the box on the iPhone

here is the site

http://szeryk.com/Guitar%20Manifesto/Mobile/

also trying to make this page http://szeryk.com/Guitar%20Manifesto/ if site viewed on iPhone or iPad redirect to http://szeryk.com/Guitar%20Manifesto/Mobile/

thank you

Re: iPhone

Posted: Tue Nov 08, 2011 1:17 pm
by ebgames56
Bump

Re: iPhone

Posted: Tue Nov 08, 2011 1:49 pm
by ebgames56
Bump

Re: iPhone

Posted: Tue Nov 08, 2011 2:27 pm
by Benjamin
Bump again and the post will be locked.

Re: iPhone

Posted: Tue Nov 08, 2011 3:05 pm
by mikeashfield
For sites to be displayed using the native iOS GUI then I'd suggest looking into iWebKit. I use it here on my own project.

To get the redirect to happen when the page is accessed on an iPhone, use something like this:

Code: Select all

<html>
<head>
<meta name="generator" content="HTML Tidy for Linux (vers 6 November 2007), see www.w3.org">
<?php
function curPageURL() {
 $pageURL = 'http';
 if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
 $pageURL .= "://";
 if ($_SERVER["SERVER_PORT"] != "80") {
  $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
 } else {
  $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
 }
 return $pageURL;
}
if (screen.width <= 699) {
document.location = curPageURL() . "/Mobile";
}
?>
</head>
<title></title>
</style>
</head>
<body>
// your page content should the page be viewed on a PC (or anything other than a mobile device with a screen size smaller than 700px)
</body>
</html>

Any problems give me a shout! :)