Jump to content

redirect to different sites


ameliabob
 Share

Recommended Posts

I writing some code to make my site respond differently based on iphone/computer/tablet I point to a startup.php<?php $useragent = $_SERVER['HTTP_USER_AGENT']; $a = explode("(",$useragent); $d = explode(";",$a[1]); switch (substr($d[0],0,6)){ case "iPhone": echo("Its an iPhone."); break; case "Window": echo("Its a computer."); break; default: echo("The device called is ".$d[0]." and needs to be added."); }?> I would like to go to a routine in the same directory such as computer_startup.php oriphone_startup.php. replacing the echo statements above. Can I do this in php or do I have to go back and redo this in javascript?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...