1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Javascript? Php? css.... Redirection for Mobile devices and Tablets

Discussion in 'HTML & Website Design' started by prince718, Mar 20, 2012.

  1. #1
    Hello. I came to the conclusion that I am going to make a seperate version of my site for Iphones/Ipods/Blackberry/Android/Windows phone devices and Tablets. Well, and ofcourse regular desktop version. Now I was trying to decide if I should use Javascript to get the screen size and then redirect to a custom page for the mobile devices. But on the other hand, I plan on having some dynamic pages creeated for me.

    My site partyprinceproductions.com will have pictures locked behind a login form. So basicallly, I will implement PHP in the coming month to lock the site after someone clicks on a thumbnail of an event. I offer event photography, and I have a general page which features the events I shot. Then they click on the event page that they would like to see pics for. And on that page it will have thumbnails of each pic. When they click on the thumbnail to view larger, thats when they will be required to login. I would like to somehow automate the process of uploading the pics, and have them watermarked, thumbnailed and have an event page created for it.......... Soooo aside from the thumbnailing, watermarking and page creation.... I want to get a grasp on what I am going to need to do. So that I can start rebuilding my site with the future in mind. Should I have Javascript redirect to a seperate site depending on screen size? Should I have it "pass" the info to PHP to serve the appropriate page? Should I just have PHP do it?

    What are some tips you can give. Or even the slightest code examples would be appreciated. I am just trying to get an understanding, and all info appreciated. Thanx in advance.
     
    prince718, Mar 20, 2012 IP
  2. SoftCloud

    SoftCloud Well-Known Member

    Messages:
    1,060
    Likes Received:
    28
    Best Answers:
    2
    Trophy Points:
    120
    #2
    You could use this PHP class that'll detect if they're on a mobile platform. :)
     
    SoftCloud, Mar 20, 2012 IP
    prince718 likes this.
  3. prince718

    prince718 Peon

    Messages:
    57
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Wow. Thanx. This seems very good. But if I were to do this:

    Then they would automatically send to the new version, which is great. But If I wanted to offer the user an option to view the regular desktop version, then what would I do?
     
    prince718, Mar 20, 2012 IP
  4. prince718

    prince718 Peon

    Messages:
    57
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    And is this in the latest version of PHP? Have you tested? Just want something thats going to be solid. Solid across new and old android, new and old iphone, etc...
     
    prince718, Mar 20, 2012 IP
  5. Anvil

    Anvil Peon

    Messages:
    31
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    It works great. I used this class to a few projects, and everything is alright.
     
    Anvil, Mar 20, 2012 IP
  6. prince718

    prince718 Peon

    Messages:
    57
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Cool. Thanx. Is that the only thing you use for Mobile sites? Do you do any tweeking? Or any additional Javascript redirection?
     
    prince718, Mar 20, 2012 IP