Page 1 of 1

Windows cannot open this file: index.php

PostPosted: 11. May 2009 10:32
by oculus
Hi,

I think I need somebody's help on this matter. I've been creating Web sites using HTML and I encountered no problem in viewing them on my browsers (IE, Firefox, Chrome). I tried using XAMPP just awhile ago and clicked C:\xampp\htdocs\index.php. However, the browser asked me to save the file. My query is that, how do I view these .php files?

Response is highly appreciated!
Thank you,
Oculus

Re: Windows cannot open this file: index.php

PostPosted: 11. May 2009 10:36
by Nobbie
>My query is that, how do I view these .php files?

http://127.0.0.1/index.php

Re: Windows cannot open this file: index.php

PostPosted: 11. May 2009 10:39
by Sharley
You can't open a php file like you would in explorer in your browser you need to use a URI like http://localhost/index.php so the web server will parse the code.

If you want to open a php file for editing then drag the file into your open text editor or associate .php files with your text editor etc.

Re: Windows cannot open this file: index.php

PostPosted: 11. May 2009 10:46
by oculus
Wow! Thanks for the speedy response!

Okay, this is it: I created a page with "hello.php" filename using notepad. I'm using Windows XP SP2, btw. I saved it to C:\xampp\htdocs\new folder. But when I tried accessing it; typing http://localhost/hello.php or C:\xampp\htdocs\new\hello.php, the browser (Firefox 3) suddenly asks me to save the file. Why is it happening?

Re: Windows cannot open this file: index.php

PostPosted: 11. May 2009 10:49
by Wiedmann
"hello.php" ... saved it to C:\xampp\htdocs\new folder. But when I tried accessing it; typing http://localhost/hello.php

http://localhost/new/hello.php

Re: Windows cannot open this file: index.php

PostPosted: 11. May 2009 10:54
by oculus
BINGO!!!

From the Land of where intelligence exists,

A MAGNANIMOUS GRATITUDE TO WIEDMANN! A+ from Harvard! LOL

Signed,
The Young Savant (LOL)


Thank you thank you!!!