boy3696 Posted November 12, 2010 Share Posted November 12, 2010 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: For Chrome: 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. Quote Link to comment https://forums.phpfreaks.com/topic/218496-php-and-firefox/ Share on other sites More sharing options...
Minimeallolla Posted November 12, 2010 Share Posted November 12, 2010 why are you downloading about.html ? you are trying to view the html not download it right? Quote Link to comment https://forums.phpfreaks.com/topic/218496-php-and-firefox/#findComment-1133475 Share on other sites More sharing options...
boy3696 Posted November 12, 2010 Author Share Posted November 12, 2010 I'm just trying to view it. Firefox for some reason thinks it's a download, same as chrome. I'm pretty sure it has something to do with PHP, but not 100% sure, and haven't a clue why it's doing this. Quote Link to comment https://forums.phpfreaks.com/topic/218496-php-and-firefox/#findComment-1133479 Share on other sites More sharing options...
arbitter Posted November 12, 2010 Share Posted November 12, 2010 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! Quote Link to comment https://forums.phpfreaks.com/topic/218496-php-and-firefox/#findComment-1133480 Share on other sites More sharing options...
ManiacDan Posted November 12, 2010 Share Posted November 12, 2010 When firefox prompts for download of a file, it's usually a header problem. Use the PHP header() function to output the proper headers for a text/html document. -Dan Quote Link to comment https://forums.phpfreaks.com/topic/218496-php-and-firefox/#findComment-1133496 Share on other sites More sharing options...
boy3696 Posted November 12, 2010 Author Share Posted November 12, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/218496-php-and-firefox/#findComment-1133502 Share on other sites More sharing options...
arbitter Posted November 12, 2010 Share Posted November 12, 2010 No problem, glad I could help! Don't forget to mark this topic als solved, by clicking the green button on the bottom of the page;) Quote Link to comment https://forums.phpfreaks.com/topic/218496-php-and-firefox/#findComment-1133504 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.