squiblo Posted August 16, 2009 Share Posted August 16, 2009 Ok, I just want my webpage to be view in Firefox because ive not yet sorted it out for all browsers and it looks really bad apart from in Firefox, so i have this little bit of code that only allows the page to be viewed by Firefox but ive tried it in my page script but i think im doing it wrong because its not working... this is so my page can only be viewed in Firefox <?php $browser = get_browser(null, true); if ($browser["browser"] == "Firefox") { // Firefox only stuff } else { // Go download a real browser. } ?> and the is my web page <?php session_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <meta http-equiv="Content-Style-Type" content="text/css"> <meta name="description" content="Squiblo.com is currently under construction but is being worked on to provide business information where you can find business numbers, addresses, websites and rate your favourites." /> <meta name="keywords" content="business search, local search, search, United Kingdom search engine, business services, services, business directory, products, squiblo, squiblo.com, local info, mobile, company info, addresses, phone numbers, websites, local maps, maps, directions, driving directions, walking directions, car parks, toolbar, advertising, build your own website, web link, domain name" /> <title>Squibo.com - Find the business information you need!</title> <style type="text/css"> body { color: white; background-color: #E6E6E6; font-size:12px; font-family: Verdana, Arial, Helvetica, sans-serif; text-align: left; } div#content { width: 75%; height: 90%; background-color:#508ace; margin-top: 30px; margin-bottom: 50px; margin-left: auto; margin-right: auto; padding: 0px; border: thin solid #E6E6E6; } div#heading { font-size:72px; font-family: Impact; position:absolute; top:82px; left:180px; } div#options { color: yellow; font-size:15px; position:absolute; top:145px; left:955px; } .hr1 { color: #E6E6E6; background-color: #E6E6E6; height: 3px; position:relative; top:130px; } div#nav { font-size:15px; position:absolute; top:173px; left:180px; } div#extranav { font-size:15px; position:absolute; top:173px; left:660px; } div#logout { font-size:15px; position:absolute; top:173px; left:990px; } .hr2 { color: #E6E6E6; background-color: #E6E6E6; height: 3px; position:relative; top:150px; } div#slogan { color: yellow; font-size:25px; position:absolute; top: 230px; left:380px; } div#searchfor { color:black; font-size:16px; position:absolute; top: 320px; left:240px; } div#companyname { color:black; font-size:16px; position:absolute; top: 320px; left:480px; } div#location { color:black; font-size:16px; position:absolute; top: 320px; left:718px; } div#homesearch { position:absolute; top: 340px; left:240px; } div#eg1 { color:#E6E6E6; position:absolute; top: 375px; left:240px; } div#eg2 { color:#E6E6E6; position:absolute; top: 375px; left:480px; } div#eg3 { color:#E6E6E6; position:absolute; top: 375px; left:718px; } .hrbreak { color: #FFFFFF; background-color: #FFFFFF; height: 2px; width: 80%; margin-left: auto; margin-right: auto; margin-top: 430px; margin-bottom: auto; } div#advertise { text-decoration:none; font-size:33px; color:white; position:absolute; top: 500px; left:280px; } div#footlinks { color: black; position:absolute; top:570px; left:230px; } </style> </head> <link REL="SHORTCUT ICON" HREF="./favicon.ico"> <body> <div id="content"> <div id="heading"> <a href="/index.php" style="text-decoration:none"><font color=#FFFFFF> <?php echo "SQUIBLO.COM"; ?> </a></font> </div> <div id="options"> <?php if($_SESSION['mycompany']) { echo "Welcome " . ucwords(strtolower($_SESSION['mycompany'])); ?> <?php } else { echo "<a href='login.php' style='text-decoration:none'><font color=#FFFF00>Sign in </a></font>/ Register"; } ?> </div> <div class="hr1"><hr /></div> <div id="nav"> <a href="/index.php" style="text-decoration:none"><font color=#FFFFFF> <?php echo "Home"; ?> </a></font> <?php echo "Maps"; ?> <?php echo "Categories"; ?> <?php echo "Learn More"; ?> </div> <div id="extranav"> <a href="#" style="text-decoration:none"><font color=#FFFFFF><b> <?php if($_SESSION['mycompany']) { echo "Your Page"; ?></a></font></b> <a href="#" style="text-decoration:none"><font color=#FFFFFF><b> <?php { echo "Settings"; } ?> <?php } else { echo ""; } ?> </a></font></b></div> <div id="logout"> <a href="/logout.php" style="text-decoration:none"><font color=#FFFFFF> <?php if($_SESSION['mycompany']) { echo "[Log out]"; ?> <?php } else { echo ""; } ?> </a></font></div> <div class="hr2"><hr /></div> <div id="slogan"> <?php echo "Find the business information you need!"; ?> </div> <div id="searchfor"> <?php echo "Search for:"; ?> </div> <div id="companyname"> <?php echo "And/or company name:"; ?> </div> <div id="location"> <?php echo "Located in:"; ?> </div> <div id="homesearch"> <form name="form1" method="post" action="checklogin.php"> <input type="text" id="categories" style="font-size:20px;"> <input type="text" id="company" style="font-size:20px;"> <input type="text" id="location" style="font-size:20px;"> <input type="submit" id="indexsearch" name="search" value="Search" style="height:35px;"> </form> </div> <div id="eg1"> <?php echo "e.g. builders, gardeners"; ?> </div> <div id="eg2"> <?php echo "e.g. Squiblo"; ?> </div> <div id="eg3"> <?php echo "e.g. country, city, postcode/zip"; ?> </div> <div class="hrbreak"<hr /></div> <a href="#" style="text-decoration:none"><font color=#FFFFFF> <div id="advertise"> <?php echo "Advertise your company with Squiblo.com"; ?> </div> </a></font> <div id="footlinks"> <?php echo "Squiblo © 2009"; ?> <a href="/about.php" style="text-decoration:none"><font color=#000000> <?php echo "About Us"; ?> </a></font> <a href="/terms.php" style="text-decoration:none"><font color=#000000> <?php echo "Terms and Conditions"; ?> </a></font> <a href="/contact.php" style="text-decoration:none"><font color=#000000> <?php echo "Contact Us"; ?> </a></font> <a href="/privacy.php" style="text-decoration:none"><font color=#000000> <?php echo "Privacy"; ?> </a></font> <a href="/help.php" style="text-decoration:none"><font color=#000000> <?php echo "Help"; ?> </div> </div> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/170493-putting-two-codes-together/ Share on other sites More sharing options...
DEVILofDARKNESS Posted August 16, 2009 Share Posted August 16, 2009 <?php session_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <?php $browser = get_browser(null, true); if ($browser["browser"] == "Firefox") { // Firefox only stuff ?> <head> <meta http-equiv="Content-Style-Type" content="text/css"> <meta name="description" content="Squiblo.com is currently under construction but is being worked on to provide business information where you can find business numbers, addresses, websites and rate your favourites." /> <meta name="keywords" content="business search, local search, search, United Kingdom search engine, business services, services, business directory, products, squiblo, squiblo.com, local info, mobile, company info, addresses, phone numbers, websites, local maps, maps, directions, driving directions, walking directions, car parks, toolbar, advertising, build your own website, web link, domain name" /> <title>Squibo.com - Find the business information you need!</title> <style type="text/css"> body { color: white; background-color: #E6E6E6; font-size:12px; font-family: Verdana, Arial, Helvetica, sans-serif; text-align: left; } div#content { width: 75%; height: 90%; background-color:#508ace; margin-top: 30px; margin-bottom: 50px; margin-left: auto; margin-right: auto; padding: 0px; border: thin solid #E6E6E6; } div#heading { font-size:72px; font-family: Impact; position:absolute; top:82px; left:180px; } div#options { color: yellow; font-size:15px; position:absolute; top:145px; left:955px; } .hr1 { color: #E6E6E6; background-color: #E6E6E6; height: 3px; position:relative; top:130px; } div#nav { font-size:15px; position:absolute; top:173px; left:180px; } div#extranav { font-size:15px; position:absolute; top:173px; left:660px; } div#logout { font-size:15px; position:absolute; top:173px; left:990px; } .hr2 { color: #E6E6E6; background-color: #E6E6E6; height: 3px; position:relative; top:150px; } div#slogan { color: yellow; font-size:25px; position:absolute; top: 230px; left:380px; } div#searchfor { color:black; font-size:16px; position:absolute; top: 320px; left:240px; } div#companyname { color:black; font-size:16px; position:absolute; top: 320px; left:480px; } div#location { color:black; font-size:16px; position:absolute; top: 320px; left:718px; } div#homesearch { position:absolute; top: 340px; left:240px; } div#eg1 { color:#E6E6E6; position:absolute; top: 375px; left:240px; } div#eg2 { color:#E6E6E6; position:absolute; top: 375px; left:480px; } div#eg3 { color:#E6E6E6; position:absolute; top: 375px; left:718px; } .hrbreak { color: #FFFFFF; background-color: #FFFFFF; height: 2px; width: 80%; margin-left: auto; margin-right: auto; margin-top: 430px; margin-bottom: auto; } div#advertise { text-decoration:none; font-size:33px; color:white; position:absolute; top: 500px; left:280px; } div#footlinks { color: black; position:absolute; top:570px; left:230px; } </style> </head> <link REL="SHORTCUT ICON" HREF="./favicon.ico"> <body> <div id="content"> <div id="heading"> <a href="/index.php" style="text-decoration:none"><font color=#FFFFFF> <?php echo "SQUIBLO.COM"; ?> </a></font> </div> <div id="options"> <?php if($_SESSION['mycompany']) { echo "Welcome " . ucwords(strtolower($_SESSION['mycompany'])); ?> <?php } else { echo "<a href='login.php' style='text-decoration:none'><font color=#FFFF00>Sign in </a></font>/ Register"; } ?> </div> <div class="hr1"><hr /></div> <div id="nav"> <a href="/index.php" style="text-decoration:none"><font color=#FFFFFF> <?php echo "Home"; ?> </a></font> <?php echo "Maps"; ?> <?php echo "Categories"; ?> <?php echo "Learn More"; ?> </div> <div id="extranav"> <a href="#" style="text-decoration:none"><font color=#FFFFFF><b> <?php if($_SESSION['mycompany']) { echo "Your Page"; ?></a></font></b> <a href="#" style="text-decoration:none"><font color=#FFFFFF><b> <?php { echo "Settings"; } ?> <?php } else { echo ""; } ?> </a></font></b></div> <div id="logout"> <a href="/logout.php" style="text-decoration:none"><font color=#FFFFFF> <?php if($_SESSION['mycompany']) { echo "[Log out]"; ?> <?php } else { echo ""; } ?> </a></font></div> <div class="hr2"><hr /></div> <div id="slogan"> <?php echo "Find the business information you need!"; ?> </div> <div id="searchfor"> <?php echo "Search for:"; ?> </div> <div id="companyname"> <?php echo "And/or company name:"; ?> </div> <div id="location"> <?php echo "Located in:"; ?> </div> <div id="homesearch"> <form name="form1" method="post" action="checklogin.php"> <input type="text" id="categories" style="font-size:20px;"> <input type="text" id="company" style="font-size:20px;"> <input type="text" id="location" style="font-size:20px;"> <input type="submit" id="indexsearch" name="search" value="Search" style="height:35px;"> </form> </div> <div id="eg1"> <?php echo "e.g. builders, gardeners"; ?> </div> <div id="eg2"> <?php echo "e.g. Squiblo"; ?> </div> <div id="eg3"> <?php echo "e.g. country, city, postcode/zip"; ?> </div> <div class="hrbreak"<hr /></div> <a href="#" style="text-decoration:none"><font color=#FFFFFF> <div id="advertise"> <?php echo "Advertise your company with Squiblo.com"; ?> </div> </a></font> <div id="footlinks"> <?php echo "Squiblo © 2009"; ?> <a href="/about.php" style="text-decoration:none"><font color=#000000> <?php echo "About Us"; ?> </a></font> <a href="/terms.php" style="text-decoration:none"><font color=#000000> <?php echo "Terms and Conditions"; ?> </a></font> <a href="/contact.php" style="text-decoration:none"><font color=#000000> <?php echo "Contact Us"; ?> </a></font> <a href="/privacy.php" style="text-decoration:none"><font color=#000000> <?php echo "Privacy"; ?> </a></font> <a href="/help.php" style="text-decoration:none"><font color=#000000> <?php echo "Help"; ?> </div> </div> </body> <?php } else { <head> <title>Download a real Browser</title> </head> <body> Download a real Browser! </body> } ?> </html> Quote Link to comment https://forums.phpfreaks.com/topic/170493-putting-two-codes-together/#findComment-899362 Share on other sites More sharing options...
squiblo Posted August 16, 2009 Author Share Posted August 16, 2009 Parse error: syntax error, unexpected '<' on line 419 Quote Link to comment https://forums.phpfreaks.com/topic/170493-putting-two-codes-together/#findComment-899365 Share on other sites More sharing options...
DEVILofDARKNESS Posted August 16, 2009 Share Posted August 16, 2009 Yeah, sorry you should replace the last part (after the </body> tag) with: <?php } else { ?> <head> <title>Download a real Browser</title> </head> <body> Download a real Browser! </body> <?php } ?> </html> Quote Link to comment https://forums.phpfreaks.com/topic/170493-putting-two-codes-together/#findComment-899368 Share on other sites More sharing options...
squiblo Posted August 16, 2009 Author Share Posted August 16, 2009 Warning: get_browser() [function.get-browser]: browscap ini directive not set on line 12 Download a real Browser! i dont have a clue what that means Quote Link to comment https://forums.phpfreaks.com/topic/170493-putting-two-codes-together/#findComment-899370 Share on other sites More sharing options...
DEVILofDARKNESS Posted August 16, 2009 Share Posted August 16, 2009 read this, maybe it helps: Quote Link to comment https://forums.phpfreaks.com/topic/170493-putting-two-codes-together/#findComment-899372 Share on other sites More sharing options...
squiblo Posted August 16, 2009 Author Share Posted August 16, 2009 my website is hosted with "one.com" and php.ini files are hidden and unable to change defaul php parameters is there anyother way of doing this? Quote Link to comment https://forums.phpfreaks.com/topic/170493-putting-two-codes-together/#findComment-899376 Share on other sites More sharing options...
DEVILofDARKNESS Posted August 16, 2009 Share Posted August 16, 2009 I'm afraid there isn't, although there I don't know one. maybe the PHP Recommended people know some other way. Quote Link to comment https://forums.phpfreaks.com/topic/170493-putting-two-codes-together/#findComment-899395 Share on other sites More sharing options...
wildteen88 Posted August 16, 2009 Share Posted August 16, 2009 ... maybe the PHP Recommended people know some other way. A better way would be fix your HTML/CSS so it works with all major browsers. If its only working with Firefox then you're doing something wrong. Quote Link to comment https://forums.phpfreaks.com/topic/170493-putting-two-codes-together/#findComment-899398 Share on other sites More sharing options...
DEVILofDARKNESS Posted August 16, 2009 Share Posted August 16, 2009 Why can't I say something like that FF has a lot of users in meantime, but IE still has (hower it shouldn't) the most users because it comes standard with windows. So change your code and you not have to find some backdoors. Quote Link to comment https://forums.phpfreaks.com/topic/170493-putting-two-codes-together/#findComment-899407 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.