Jump to content

Recommended Posts

Hi Everyone:

 

I'm sorry if this was posted before, but I'm just grasping at straws now and need some help. My appologies if it's in the wrong forum as well. :-[

 

I've been searching the internet for answers from others who had the same issue as I, but so far have not be successfull in resolving my own issue.

 

I currently have my own site, and I wanted to keep up with today's standards and offer a mobile site for users. For this, I automatically check the users browser type and direct them accordingly.

 

To do this, I grabbed code off the internet to use PHP. This redirects perfectly, but here's my problem:

 

The mobile site seems to be working fine and I can use my iPhone and iPad to view the mobile site with no issues.

When I go to my site using IE, again, it works properly ok... BUT, when I go to my site using Firefox or Chrome (so far I just tried these 2, I'm sure there's probably another) I get this message

 

For Firefox:

FirefoxMessage.jpg

 

For Chrome:

ChromeMessage.jpg

 

I'm not 100% sure, but I think it may be because I use a PHP file coming into the site to determine where to route the user to what page.

I know literally nothing about PHP, so most of the stuff has been taken off the internet.

 

Here is what I have in the .htaccess file:

 

AddType application/x-httpd-php .html

AddType application/x-httpd-php .htm

AddType application/x-httpd-php .css

AddType application/x-httpd-php .js

 

I also have a file named php.ini which contains the following:

 

register_globals = off

allow_url_fopen = off

 

expose_php = Off

max_input_time = 60

variables_order = "EGPCS"

extension_dir = ./

upload_tmp_dir = /tmp

precision = 12

SMTP = relay-hosting.secureserver.net

url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset="

 

[Zend]

zend_extension=/usr/local/zo/ZendExtensionManager.so

zend_extension=/usr/local/zo/4_3/ZendOptimizer.so

 

   

zlib.output_compression = On 

zlib.output_compression_level = 6 

auto_prepend_file = "pre.php" 

short_open_tag = 0

 

[b]The pre.php file contains the following:[/b]<?php 

 

$path = pathinfo($_SERVER['SCRIPT_NAME']); 

 

if ($path['extension'] == 'css')  { 

  header('Content-type: text/css'); 

 

if ($path['extension'] == 'js')  { 

  header('Content-type: application/x-javascript'); 

?>

 

[b]Here is what my first few lines of the html consist of for this particular example:[/b]

 

<html>

<HEAD>

<TITLE>Cilla Black Mania</TITLE>

<!-- meta http-equiv="Content-Type" content="text/html; charset=UTF-8" / -->

</HEAD>

<body bgcolor="#1A1A1A">

 

Can anyone help me out with this issue? I'm very frustrated and tried almost everything where I'm getting more confused about PHP.

 

Thanking you in advance,

Dan.

 

Link to comment
https://forums.phpfreaks.com/topic/218496-php-and-firefox/
Share on other sites

Well, as far as the mobile part goes; it does detect correctly if it is a mobile device or not. Seen that on a mobile device it shows 'mobile', and on a non-mobile device it doesn't.

 

As for your problem; this is indeed strange.

I can only assume that the problem is in your .htaccess file; delete 'AddType application/x-httpd-php .html' and try it again. Though it's never good to mess with the .htaccess file!

Link to comment
https://forums.phpfreaks.com/topic/218496-php-and-firefox/#findComment-1133480
Share on other sites

To arbitter:

Thanks a million arbitter. I just removed everything from the .htaccess and it's now showing in firefox AND chrome with no issues. I also verified it's still working on a mobile device. Thanks for your help.

 

@ManiacDan... Nice Name ;-)

Since arbitter's suggestion worked, and being a novice at all this stuff, I'm going to let lying dogs lie. I've spent so much time on this that I was just happy to see the pages come up in Firefox and Chrome, and I'm going to take a few days off of this now.

 

Thanks Everyone for your interest.

Dan. aka Danimal.

Link to comment
https://forums.phpfreaks.com/topic/218496-php-and-firefox/#findComment-1133502
Share on other sites

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.