Reply to Re: How not to send headers?

Your name:

Reply:


Posted by Jerry Stuckle on 12/10/38 11:57

CptDondo wrote:
> Let me explain my situation:
>
> I have a PHP app that generates web pages on the fly based on some data
> it reads from XML files. The pages are served up via a http server and
> displayed with a browser.
>
> I've been asked to port this to an ANSI terminal-type display,
> eliminating the web server and browser.
>
> Initially I thought about using C to write the app, but XML handling in
> C is a real PITA, plus I don't get to reuse my PHP code.
>
> So, now I want to use PHP to generate those same pages except that I
> don't want to send headers ever, and I need to loop waiting for
> characters to arrive from the keypad and display pages based on those
> chars...
>
> This is on an embedded platform, and I really need to be able to use a
> single PHP binary for both purposes (the displays are interchangeable at
> the hardware level; it all depends on what the customer pays for.)
>
> How do I get php to act as just another scripting language?
>
> Thanks,
>
> --Yan

Yan,

If you're running on a web server, the headers will always be sent. PHP
doesn't send the headers, the web server does.

You can run it as a batch job, in which case the headers won't be sent.
But while you'll probably be able to use some of the code, you won't
be able to easily make the same program work both ways. At least not
without a lot of if($onwebserver){...} else {...} constructs.

Probably better to create two files and one or more include files for
the code you can use in both.


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация