|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (9 bit)
Join Date: Sep 2004
Posts: 418
|
PHP on my system
Okay so I'm trying to learn PHP, so I installed PHP on my system. I figured that it would let php files on my harddrive load properly. I made my first php file (embeded php in html) and IE just shows all the text in the file (the code) and Mozilla attempts to display it as HTML. Am I doing something wrong or do I have to upload the files to a server before they can be used properly? Thanks
|
|
|
|
|
|
#2 |
|
Member (9 bit)
Join Date: Sep 2004
Posts: 418
|
update:
Okay I put Apache on my system and configured PHP, linking it to the folder that I have those files in. Now when I type the domain of my computer that I'm on, the PHP is working, but when I go through my computer to the php file on my harddrive, php doesn't work. Is there a way around this? |
|
|
|
|
|
#3 |
|
Member (8 bit)
Join Date: Aug 2003
Location: SoCal
Posts: 178
|
That's the way it is supposed to work. PHP stands for PHP Hypertext Preprocessor. PHP files on their own are just that--a set of PREprocessor instructions, still meaningless--until they have been "parsed" (executed and interpreted into HTML, which is sent to the browser.) The parsing is performed by the server, which is Apache in this case. The way you request Apache to parse the file is by accessing it through the server address, localhost/file.php.
EDIT: So in short, no, there isn't a workaround, at least not that I have heard of. Why would there need to be? It's just as easy to access the file in the web browser window as in the file browser window. Last edited by jong2k4; 06-06-2005 at 12:07 AM. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|