Re: php Problems

From: Date: Sun, 10 Dec 2000 22:33:17 +0000
Subject: Re: php Problems
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-29599@lists.php.net to get a copy of this message
yes its baffling me. I have perl too. That runs fine under apache but requires a 'print "Content-type: text/html\n";' or the browser throws a wobbler there too. The error under pws mentions a http header and I thought that was the "Content-type: text/html\n"; which is why I included it in the php script Matthew Ballard <Matthew@TheAirport.com> wrote in message news:5.0.2.1.2.20001210140043.01c1f1f8@mail.earthlink.net... > 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 > > > -- > 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 >

« previous php.general (#29599) next »