Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
PHP in .html file, no access to htaccess or .php extension
Old 03-02-2009, 08:04 PM PHP in .html file, no access to htaccess or .php extension
Junior Talker

Posts: 3
Name: Evan Janneson
Trades: 0
Hello, all. I apologize if this question has been answered, but my attempts to search have yielded only standard results (htaccess, .php extension, the usual stuff). I also apologize if the answer is fairly obvious, but I'm still newish to PHP.

My issue is that I've recently picked up a site for a church that has some very limited options in how their website is hosted. They are in a small town, and use a local ISP as their site's host.

The church would like me to do some things on their site that, for the most part, are not difficult, but one thing I need to do is add some PHP code to the index page.

Unfortunately, the host does not provide access to the htaccess file, so I can't set index.php as the main page, nor can I set .html files to be treated like .php files.

Is there anything else that can be done so PHP can be used in a .html file?

Thank you for your time!
Jannes is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-02-2009, 10:33 PM Re: PHP in .html file, no access to htaccess or .php extension
stevej's Avatar
Professional Multitasker

Posts: 996
Location: Not positive
Trades: 0
Do you have the permission to delete files? If you did, you could delete the index.html file, and create an .php file to be used as an index (like index.php), and the user would automatically be forwarded to that.

- Steve
__________________
if($stevej == "helpful") { $talkupation += $user_power; }
stevej is offline
Reply With Quote
View Public Profile
 
Old 03-02-2009, 11:28 PM Re: PHP in .html file, no access to htaccess or .php extension
Junior Talker

Posts: 3
Name: Evan Janneson
Trades: 0
I had tried that, but I can't set anything to register index.php as the home page. Attempting to use index.php yields a 404.
Jannes is offline
Reply With Quote
View Public Profile
 
Old 03-03-2009, 01:17 AM Re: PHP in .html file, no access to htaccess or .php extension
Jaryth000's Avatar
Skilled Talker

Posts: 59
Name: Jaryth
Location: Canada
Trades: 0
" Attempting to use index.php yields a 404."

It sounds to me like an issue with the Server Configuration. Im not sure (and kinda doubt, from reading your post) that you have access to the server config... but if its running Apache for example, you can go into the httpd.conf file, and if you look at the lines:

Quote:
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
and where to change it to

Quote:
<IfModule dir_module>
DirectoryIndex index.php
</IfModule>
it should grab the php page instead of the html. If you have no access to the configs... and are 100% sure that the server DOES support PHP, then what I would do:

Have the index.html page have ONLY this in it:

Quote:
<html>
<head>
<meta http-equiv="REFRESH" content="0;url=index.php"></head>
</html>
and whenever anyone requests the index page, it would see the html page, and be automaticaly redirected to the PHP page. Its a dirty workaround, but should hopefully work!
__________________

Please login or register to view this content. Registration is FREE
My personal website
-Jaryth (UID590)
Jaryth000 is offline
Reply With Quote
View Public Profile Visit Jaryth000's homepage!
 
Old 03-03-2009, 01:38 AM Re: PHP in .html file, no access to htaccess or .php extension
Junior Talker

Posts: 3
Name: Evan Janneson
Trades: 0
Yes, I do not have any access to the server, other than being able to upload files. As I said, the host is a small-time ISP in a small town, and it is a rather poor option. I'm trying to convince the church's board to get a new host (numerous decent hosts who offer far better options at much lower costs) but until then, well, not much I can do.

I've been hoping there was some other option than a redirect, such as script tags or such, but I guess not.

C'est la vie.

Thank you, all, for your help!
Jannes is offline
Reply With Quote
View Public Profile
 
Old 03-03-2009, 10:10 PM Re: PHP in .html file, no access to htaccess or .php extension
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,918
Name: Keith Marshall
Location: Connecticut
Trades: 0
Yes - New host would be the logical solution.
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Old 03-03-2009, 10:37 PM Re: PHP in .html file, no access to htaccess or .php extension
johniman7's Avatar
President, JLI Media

Posts: 965
Name: John Irving
Trades: 0
I recommend www.awardspace.com for a free php compatable host. Very reliable and quick, but they don't allow .htaccess either but with them you can just delete index.html and use index.php and it will work.
__________________
Cheers, John Irving: My Blog
JLI Media:
Please login or register to view this content. Registration is FREE
| Website Development (Link Coming Soon!)
johniman7 is offline
Reply With Quote
View Public Profile Visit johniman7's homepage!
 
Old 03-05-2009, 09:51 AM Re: PHP in .html file, no access to htaccess or .php extension
anderswc's Avatar
Super Talker

Posts: 132
Name: Will Anderson
Location: Terre Haute, IN
Trades: 0
Or you can pay around $5 a month for "real" hosting. I did the free hosting thing for about a year before switching to paid hosting, and I have to say it's worth it. When you think about it, that's only $60 a year! If you choose a good host, you don't have any of the hassles of a free hosting solution (like no .htaccess or support).
__________________
Will Anderson

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
anderswc is offline
Reply With Quote
View Public Profile Visit anderswc's homepage!
 
Reply     « Reply to PHP in .html file, no access to htaccess or .php extension
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.26676 seconds with 12 queries