ameliabob Posted November 8, 2015 Share Posted November 8, 2015 I am trying to write a function that determines the users browser and then calls the appropriate program./function, I am using this is "startup.php" [codebox}<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /><?php $useragent = $_SERVER['HTTP_USER_AGENT']; $a = explode("(",$useragent); $d = explode(";",$a[1]); switch (substr($d[0],0,6)){ case "iPhone": header("Location: http://testcomsum.atflorida.us/phone.startup.php"); break; case "Window": header("Location:http://testcomsum.atflorida.us/c.startup.php"); break; case "Androi": header("Location: http://testcomsum.atflorida.us/phone.startup.php"); break; default: echo("The device called is ".$d[0]." and needs to be added."); }?> [/codebox] I get the message that the startup.php cannot be found. Link to comment Share on other sites More sharing options...
funbinod Posted November 8, 2015 Share Posted November 8, 2015 I get the message that the startup.php cannot be found. then it might not had found the file. check if the file exists on appropriate path that u defined.. Link to comment Share on other sites More sharing options...
dsonesuk Posted November 8, 2015 Share Posted November 8, 2015 Your code won't work because any reference to header() must be placed before any html, in this instance before the doctype declaration, else header already exists error will be shown. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now