meafafan wrote:oh, u r too kind...actually i try searching the forum the keyword "PHP" alone and got: "No suitable matches were found." :S
i found a similar question but with no answer.
Oh, thats right. Sorry for that. Some stop or short words don't work alone. But if you add one more word in your search request that should work.
meafafan wrote:i tried to open the file in the browser by two ways:
1. open file (ctrl+o)
2. i open an HTML file that calls the same simple php file
Both can't work. PHP is a serverside programming language. It can't work locally, because your Browser can't know, that you run a webserver and that all .php files should be send through the php parser.
Therefor you have installed an Apache Webserver in your XAMPP package. Your Webserver knows that .php Files must be send to the php parser.
But your Webserver don't serve local files. You had to request your files with the http protocol.
Therefor you first had to save your .php files inside the xampp\htdocs folder or into a subfolder of it. htdocs is the startfolder (documentroot) for the webserver, so the webserver knows, if someone requests a file, he starts to look in your document root folder.
For example: If you have a file test.php in the folder c:\xampp\htdocs\projectxyz\, the correct url would be
http://localhost/projectxyz/test.php(localhost is just an alias for 127.0.0.1 which is every pcs self reference ip-address.