Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
May 24, 2012, 12:17:20 PM

Pages: [1]   Go Down
  Print  
Author Topic: What is the error in this php page?  (Read 584 times)
jiwngee
Pong! (the videogame) Master
*****
Offline Offline

Posts: 26


WWW
« on: November 30, 2011, 11:58:08 PM »

I am newbie on website development and was fascinated after reading how much I can do with just PHP include. But unfortunately, I am stuck in the first step. Here is where I have uploaded the files.
Why doesn't the index page open when I go to this link? If I had made a index.html, it would have opened.

Is it a problem with a server? Should I install PHP?
Logged

MrPhil
Senior Moderator
Berserker Poster
*****
Offline Offline

Posts: 5215



« Reply #1 on: December 01, 2011, 10:00:02 AM »

You haven't given much to go on, but try this in your root directory (/) and named index.php:
Code:
<?php
echo "hello world\n";
?>

At the least, your browser will say Hello to you when you access your site. From there you can add more stuff to make it a proper HTML page. You can give your scripts other names and paths and access specific scripts in specific places within your site from the browser address bar.

If the above does not work, trying giving that path and name (/index.php) explicitly on your browser. If it then works, you have something wrong in your .htaccess file (it's not looking for an index.php file).
Logged

Visit My Site

E-mail Me
  
-= From the ashes shall rise a sooty tern =-
Pages: [1]   Go Up
  Print  
 
Jump to: