Your HostICan Community  


Go Back   Your HostICan Community > Programming & Design > PHP / MySQL Assistance

PHP / MySQL Assistance We understand. Not all of you are experienced programmers, but some of you are highly skilled at coding. So we've set aside this forum so you can ask questions, and provide answers to the most commonly asked PHP / MySQL issues.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-30-2009, 06:35 PM
sammymaudlin sammymaudlin is offline
Junior Member
 
Join Date: Jul 2009
Posts: 3
Default PHP .htaccess problem

I'm trying to run a php script linked from my index.html that checks for mobile devices and then forwards if appropriate. Problem is that I can't get the php to work from within the html. I've searched and searched and tried everything here- http://forum.hostican.com/php-mysql-...run-php-t1661/, and elsewhere and when I modify the .htaccess file the browser attempts to download something?

The main site is Trevor Jones • Voice Over . Currently the .htaccess is the unmodified version as I need this site to remain accessible.

Here's the php at the top of my index.html

Code:
 include('mobile_device_detect.php');
mobile_device_detect(true,true,true,true,'http://trevorjonesvo.com/mobile2.html/',false);?>
And here was the last .htaccess file I tried

Code:
# -FrontPage-

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*


order deny,allow
deny from all
allow from all


order deny,allow
deny from all

AuthName trevorjonesvo.com
AuthUserFile /home/trevorjo/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/trevorjo/public_html/_vti_pvt/service.grp

AddType application/x-httpd-php .html
Any help would be greatly appreciated.

Last edited by sammymaudlin; 07-30-2009 at 06:37 PM. Reason: typo
Reply With Quote
  #2  
Old 07-30-2009, 06:52 PM
randy's Avatar
randy randy is offline
Senior Member
 
Join Date: Jan 2009
Posts: 110
Default Re: PHP .htaccess problem

Piece of cake. Change this
Code:
AddType application/x-httpd-php .html
with this
Code:
AddHandler application/x-httpd-php .html .htm
Reply With Quote
  #3  
Old 07-30-2009, 07:17 PM
sammymaudlin sammymaudlin is offline
Junior Member
 
Join Date: Jul 2009
Posts: 3
Default Re: PHP .htaccess problem

Thanks Randy. That did stop the browsers from trying to download something but now it looks like the script isn't executing. On an iPod touch it should forward to the specified site but it does not...
Reply With Quote
  #4  
Old 07-30-2009, 07:28 PM
sammymaudlin sammymaudlin is offline
Junior Member
 
Join Date: Jul 2009
Posts: 3
Default Re: PHP .htaccess problem

I solved the overall issue by using a different method- Toronto Computer Repair and Business IT Support Services Provider - PC Mechanix and just adding "iphone" to the array.

Thanks.
Reply With Quote
Reply

Tags
htaccess, php, problem

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 12:30 AM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.

Copyright © 2003 - 2008 HostICan. All Rights Reserved.