0% found this document useful (0 votes)
10 views2 pages

GDD

The document outlines various PHP configuration settings, including magic quotes for escaping quotes in incoming data and the inclusion of files at the beginning or end of PHP scripts. It explains the implications of settings like file uploads, session handling, and database connection defaults. Additionally, it describes different methods for escaping to PHP code, including canonical PHP tags and short-open tags, along with their configuration requirements.

Uploaded by

fuaddacad85
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views2 pages

GDD

The document outlines various PHP configuration settings, including magic quotes for escaping quotes in incoming data and the inclusion of files at the beginning or end of PHP scripts. It explains the implications of settings like file uploads, session handling, and database connection defaults. Additionally, it describes different methods for escaping to PHP code, including canonical PHP tags and short-open tags, along with their configuration requirements.

Uploaded by

fuaddacad85
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

magic_quotes_gpc = On

This setting escapes quotes in incoming GET/POST/COOKIE data. If you use a lot of
forms
which possibly submit to themselves or other forms and display form values, you may
need
to set this directive to On or prepare to use addslashes() on string-type data.
magic_quotes_runtime = Off
This setting escapes quotes in incoming database and text strings. Remember that
SQL adds
slashes to single quotes and apostrophes when storing strings and does not strip
them off
when returning them. If this setting is Off, you will need to use stripslashes()
when outputting
any type of string data from a SQL database. If magic_quotes_sybase is set to On,
this must
be Off.
magic_quotes_sybase = Off
This setting escapes single quotes in incoming database and text strings with
Sybase-style
single quotes rather than backslashes. If magic_quotes_runtime is set to On, this
must be
Off.
auto-prepend-file = [path/to/file]
If a path is specified here, PHP must automatically include() it at the beginning
of every PHP
file. Include path restrictions do apply.
auto-append-file = [path/to/file]
If a path is specified here, PHP must automatically include() it at the end of
every PHP
file.unless you escape by using the exit() function. Include path restrictions do
apply.
include_path = [DIR]
If you set this value, you will only be allowed to include or require files from
these directories.
The include directory is generally under your document root; this is mandatory if
you.re
running in safe mode. Set this to . in order to include files from the same
directory your script
is in. Multiple directories are separated by colons:
.:/usr/local/apache/htdocs:/usr/local/lib.
doc_root = [DIR]
If you.re using Apache, you.ve already set a document root for this server or
virtual host in
httpd.conf. Set this value here if you.re using safe mode or if you want to enable
PHP only on
a portion of your site (for example, only in one subdirectory of your Web root).
file_uploads = [on/off]
Turn on this flag if you will upload files using PHP script.
upload_tmp_dir = [DIR]
Do not uncomment this line unless you understand the implications of HTTP uploads!
PHP
22
session.save-handler = files
Except in rare circumstances, you will not want to change this setting. So don't
touch it.
ignore_user_abort = [On/Off]
This setting controls what happens if a site visitor clicks the browser.s Stop
button. The default
is On, which means that the script continues to run to completion or timeout. If
the setting is
changed to Off, the script will abort. This setting only works in module mode, not
CGI.
mysql.default_host = hostname
The default server host to use when connecting to the database server if no other
host is
specified.
mysql.default_user = username
The default user name to use when connecting to the database server if no other
name is
specified.
mysql.default_password = password
The default password to use when connecting to the database server if no other
password is
specified.
PHP
23
Escaping to PHP
The PHP parsing engine needs a way to differentiate PHP code from other elements in
the
page. The mechanism for doing so is known as 'escaping to PHP.' There are four ways
to do
this:
Canonical PHP tags
The most universally effective PHP tag style is:
<?php...?>
If you use this style, you can be positive that your tags will always be correctly
interpreted.
Short-open (SGML-style) tags
Short or short-open tags look like this:
<?...?>
Short tags are, as one might expect, the shortest option You must do one of two
things to
enable PHP to recognize the tags:
 Choose the --enable-short-tags configuration option when you're building PHP.
 Set the short_open_tag setting in your php.ini file to on. This option must be
disabled
to parse XML with PHP because the same syntax is used for XML tags.
ASP-style tags
ASP-style tags mimic the tags used by Active Server Pages to delineate code blocks.
ASPstyle tags look like this:
<%...%>
To use ASP-style tags, you will need to set the configuration option in your
php.ini file.
HTML script tags
HTML script tags look like this:

You might also like