Re: php Problems
| From: | Matthew Ballard | Date: | Sun, 10 Dec 2000 22:06:25 +0000 |
| Subject: | Re: php Problems | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-29592@lists.php.net to get a copy of this message | ||
I'm not sure why you are getting that specific Header, but for your information, as long as the web server is configured to handle PHP files automatically (using either CGI binary in cgi-bin, or using the module version), you don't need that first line (it would just be output by the browser), and you can't send Content-type's using echo or print, because upon encountering the first line of text or an echo/print, it automatically send out a Content-type header of text/html. If you want to send one manually, you have to use Header("Content-type: text/html\n\n");. Also FYI, parentheses around the quotes in the echo statements is entirely optional.
Matthew
At 07:18 PM 12/10/2000 +0000, you wrote:
Hello all. I've recently acquired php and ive got both apache and pws. I'm having trouble getting either of the servers to run my php scripts. when I run PHP from the command line it runs my script fine. The error message I get is that I haven't included all the relevant header information. Can anyone tell me what is missing please? here's my code #!PHP <?php echo "Content-type: text/html\n\n"; echo ("<html><head><title>test</title></head><body>\n"); echo ("this is the simplest, an SGML processing instruction\n"); echo("if you want to serve XML documents, do like this\n"); echo("</body></html>") ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net