faqts : Computers : Programming : Languages : PHP : Common Problems

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

29 of 67 people (43%) answered Yes
Recently 5 of 10 people (50%) answered Yes

Entry

How can I view php script results on my local machine?

Jul 19th, 2004 23:22
Alder Rus, Matt Gregory, David Devidal, http://www.directoryonclick.com , http://www.singapore-yellow-pages.com


Your browser sees .php, .php3, and .phtml files as non-html, which 
means it will do the default load options for the page when you click 
on the file (Depending on your browser settings, it will either edit 
the file or try to show it as plain html.)
In order to view the results there are two options you can take:
  1.) To veiw the HTML results in your browser:
      Install a webserver.  For the inexperienced user running Windows 
or Windows NT I recommend Xitami.  It's fast and easy and there is 
help 
information in FAQTS:Computers:Webservers:Xitami
  2.) To view the results from the command prompt:
      To test the results of a script from the command prompt you can 
use redirects and enter php.exe < myscript.php3 > 
myscriptresult.html.  
The other option is to open windows explorer, click on View, Options, 
File Types and then add .php3 (.phtml, .php) as opened by php.exe < %1 
> %1.html.