Jump to content

Recommended Posts

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 &#169; 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>

Link to comment
https://forums.phpfreaks.com/topic/170493-putting-two-codes-together/
Share on other sites

<?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 &#169; 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>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.