11.07.2015 Views

PHP MySQL - Stilson.net

PHP MySQL - Stilson.net

PHP MySQL - Stilson.net

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

www.it-ebooks.infoCHAPTER 2 • CONFIGURING YOUR ENVIRONMENTecho "Some <strong>PHP</strong> statement";If you’re coming from an ASP background and prefer to continue using this delimiter syntax, youcan do so by enabling this tag.precision = integerScope: <strong>PHP</strong>_INI_ALL; Default value: 14<strong>PHP</strong> supports a wide variety of datatypes, including floating-point numbers. The precisionparameter specifies the number of significant digits displayed in a floating-point numberrepresentation. Note that this value is set to 12 digits on Win32 systems and to 14 digits on Linux.y2k_compliance = On | OffScope: <strong>PHP</strong>_INI_ALL; Default value: OnWho can forget the Y2K scare of just a few years ago? Superhuman efforts were undertaken toeliminate the problems posed by non-Y2K-compliant software, and although it’s very unlikely, someusers may be using wildly outdated, noncompliant browsers. If for some bizarre reason you’re sure thata number of your site’s users fall into this group, then disable the y2k_compliance parameter; otherwise,it should be enabled.output_buffering = On | Off | integerScope: <strong>PHP</strong>_INI_SYSTEM; Default value: 4096Anybody with even minimal <strong>PHP</strong> experience is likely quite familiar with the following two messages:"Cannot add header information – headers already sent""Oops, php_set_cookie called after header has been sent"These messages occur when a script attempts to modify a header after it has already been sent backto the requesting user. Most commonly they are the result of the programmer attempting to send acookie to the user after some output has already been sent back to the browser, which is impossible toaccomplish because the header (not seen by the user, but used by the browser) will always precede thatoutput. <strong>PHP</strong> version 4.0 offered a solution to this annoying problem by introducing the concept ofoutput buffering. When enabled, output buffering tells <strong>PHP</strong> to send all output at once, after the scripthas been completed. This way, any subsequent changes to the header can be made throughout thescript because it hasn’t yet been sent. Enabling the output_buffering directive turns output bufferingon. Alternatively, you can limit the size of the output buffer (thereby implicitly enabling outputbuffering) by setting it to the maximum number of bytes you’d like this buffer to contain.If you do not plan to use output buffering, you should disable this directive because it will hinderperformance slightly. Of course, the easiest solution to the header issue is simply to pass the informationbefore any other content whenever possible.23

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!