Download PHP for free from http://www.php.net/downloads.php. You'll want the PHP 5.x zip package under Windows Binaries; avoid the installer version if you can.
Unzip the file you downloaded from the PHP Website into a directory of your choice. I recommend C:\PHP and will refer to this directory from this point onward, but feel free to choose another directory if you like.
Find the files called php5ts.dll and libmysql.dll in the PHP folder and copy them to the system32 subfolder of your Windows folder (e.g. C:\WINDOWS\system32).
Find the file called php.ini-dist in the PHP folder and copy it to your Windows folder. Once it's there, rename it php.ini.
Open the php.ini file in your favorite text editor (use WordPad if Notepad doesn't display the file properly). It's a large file with a lot of confusing options, but look for a line that begins with extension_dir, and set it so that it points to the ext subfolder of your PHP folder:
extension_dir = "C:\PHP\ext"
Even further down, look for a line that starts with session.save_path and set it to your Windows TEMP folder:
session.save_path = "C:\WINDOWS\Temp"
Save the changes you made and close your text editor.
Now, if you have IIS, follow these instructions:
In the Windows Control Panel, open Administrative Tools > Internet Information Services.
In the tree view, expand the entry labelled local computer, then under Web Sites look for Default Web Site (unless you have virtual hosts set up, in which case, choose the site to which you want to add PHP support). Right-click on the site and choose Properties.
Click the ISAPI Filters tab, and click Add…. In the Filter Name field, type PHP, and in the Executable field, browse for the file called php5isapi.dll in the PHP folder. Click OK.
Click the Home Directory tab, and click the Configuration… button. On the Mappings tab, click Add. Again choose your php5isapi.dll file as the executable (note that the file type filter in the dialog is set to show .exe files only by default) and type .php in the extension box (including the .). Leave everything else unchanged and click OK. If you want your Web server to treat other file extensions as PHP files (.php3, .php4, and .phtml are common choices), repeat this step for each extension. Click OK to close the Application Configuration window.
Click the Documents tab, and click the Add… button. Type index.php as the Default Document Name and click OK. This will ensure that a file called index.php will be displayed as the default document in a given folder on your site. You may also want to add entries for index.php3 and index.phtml.
Click OK to close the Web Site Properties window. Close the Internet Information Services window.
Again, in the Control Panel under Administrative Tools, open Services. Look for the World Wide Web Publishing service near the bottom of the list. Right-click on it and choose Restart to restart IIS with the new configuration options. Close the Services window.
You re-installed WinXP because you couldn't open the file?
Anyways, go to your folder where your PHP files are stored. Hold down "Shift" and right-click any of the files. In the context menu there should be an entry "Open With". Click it and select the editor you want to use. Also mark the box at "Always use this program ..."