Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to embed php code into index.html(homepage)? 2

Status
Not open for further replies.

phphead

Technical User
Jun 21, 2003
3
0
0
US
Hi,

I'm new to this.

I have a php script, and try to use it as my index.html home page, but it doesn't work. I can load it, as home.php, directly into browser and it works, that means the code itself is OK.

Does anybody have idea to handle this? My goal is to retrieve data from MySql in my home page.

Thanks!
 
so whats the problem?

ur php page runs...

so what is is u want?

Known is handfull, Unknown is worldfull
 
It depends on the configuration of your webserver if index.php is recognized the same way index.html would be.
rename home.php to index.php and try. If it doesn't work check the setup of your server.

Depending on what webserver is in use there are different options.
 
vbkris,

The problem to me is if the <index.html> has php code, it won't work correctly (no data retrieved from MySql).

I said if I saved it as <home.php> it worked because I typed its full path into the browser, and I think home page shouldn't work that way.

DRJ478 may right. I should look at my Apache config file, but I dont know how to change it. Do you guys have any ideas on that? My original idea is to retrieve data from Mysql into my Home Page.

Thanks alot!
 
Add [tt]index.php[/tt] to your [tt]DirectoryIndex[/tt] directive.

//Daniel
 
or you could set index.html to redirect to *.php

skottieb:)
 
Hi all,

Add index.php to DirectoryIndex in the <httpd.conf> will work.

We can close this ticket.

Thanks all for your nice inputs!

-john
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top