iPhone

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ebgames56
Forum Contributor
Posts: 103
Joined: Thu Oct 06, 2011 10:43 am

iPhone

Post 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
ebgames56
Forum Contributor
Posts: 103
Joined: Thu Oct 06, 2011 10:43 am

Re: iPhone

Post by ebgames56 »

Bump
ebgames56
Forum Contributor
Posts: 103
Joined: Thu Oct 06, 2011 10:43 am

Re: iPhone

Post by ebgames56 »

Bump
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: iPhone

Post by Benjamin »

Bump again and the post will be locked.
mikeashfield
Forum Contributor
Posts: 159
Joined: Sat Oct 22, 2011 10:50 am

Re: iPhone

Post 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! :)
Post Reply