I’m trying to get this PHP based email form up and running on my dads website for him, but I’m having some trouble. Since the form is PHP, the page its on obviously has to have a .php extension. Well, I’m putting this on the index page, but whenever I upload index.php it dosen’t show in my browser. I’ve tried it in other browsers (I’m using IE) and on another computer and nothing changes so it’s obviously not just me. The site only shows up when I have index.html uploaded and even then you have to refresh once before you can see anything.
Now, the hosting is this stuff you get from rogers for buying their cable deal or something, so it’s like a bonus. My dad bought a domain name and used this to host it. I’m really not liking the way it’s set up though. It seems that rogers has put the whole site into one big frame. If you view the source code by going to view > source in the IE toolbar you’ll see a frame code, but if you right click you see the actual code for the page.
Since I can’t have index.php I obviously can’t put up the form, and I think the whole frame thing is messing up the form anyway (I’ve tried it on other .php pages on the site, which oddly enough work fine). I have no idea how to fix this. And by the way, there’s nothing wrong with the form’s script itself and I’ve called rogers and the server is compatible with PHP (don’t have any MySQL databases though).
I think the index.php is a setting problem with apache. Your server probably doesn’t have the line where the index files are listed set up correctly. What I’d do is get another host ( www.siteflip.com is good and cheap), or you could call again and ask them what their indexes line in the apache.conf is.
Hmmm, it dosen’t work. When I view the site I get a “You are not authorized to view this page” message. Besides, I have index.php pages on most of my sites, and they work fine.
Yeldarb: Thanks for referring me to that host, I’ll look into it.
What the default file for a directory is is set up in the web server. So PHP doesn’t have a default page because it’s not a web server.
My Apache server uses index.php - not home.php. And all the PHP software packages I’ve downloaded and installed assume that index.php is the default. Where have you seen that home.php should be used?
If there is an error in the code, depending on how error level is set, it might just give you a blank page. If you manually set
error_reporting (E_ALL);
at the top of your document it should warn you what if there are any errors.
Comment out (php comments) your code and see if the page displays. If it does, its your code. index.php is a server directive and has nothing to do with php (other than adding it to parse php index pages). You could add home.php if you want. But no where when installing php does it have anything to do with home.php.
If you manualy type in your page: www.somesite.com/index.php and it still doesn’t show, then its not whether or not it was added as a default page in your httpd.conf file. If you spell out a direct path and it doesn’t show it means there is an error in your code or something like that. It will default to text output if it doesn’t have instructions on handling the extension. So if php wasn’t installed you’d see text output.
To me it sounds like there is a bug in your code and if you could post the page code it might help.