php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44406 Problem with use of 'require' or 'include'
Submitted: 2008-03-11 11:35 UTC Modified: 2008-03-19 01:00 UTC
From: dennis at studiomagenta dot co dot th Assigned:
Status: No Feedback Package: Scripting Engine problem
PHP Version: 5.2.5 OS: Linux Apache 1.3.41
Private report: No CVE-ID: None
 [2008-03-11 11:35 UTC] dennis at studiomagenta dot co dot th
Description:
------------
After including a 'require' statement in my PHP script I found that an echoed output of variables in the same script inserted an unwanted and unexpected space character (%20) before the first variable name. I found the same problem when using 'include' instead of 'require'. The included PHP script is located in the root of the web server, not in the public area.

This space character effectively corrupted the name of the variable which caused it not to be recognised by my receiving Flash program.

Output before including the 'require' statement:
reply=valid user&company_name=ABC

Output after including the 'require' statement:
%20reply=valid user&company_name=ABC

Reproduce code:
---------------
<?php
require '../../userpass.php';
echo "reply=valid user&company_name=ABC";
?>


And the sample code for the required file userpass.php:

<?php 
$mySQLdatabase = 'some_database';
$mySQLusername = 'some_login'; 
$mySQLpassword = 'some_password'; 
?>

Expected result:
----------------
reply=valid user&company_name=ABC

Actual result:
--------------
%20reply=valid user&company_name=ABC

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-03-11 21:32 UTC] jani@php.net
Try removing the trailing ?> (it's optional anyway..)
 [2008-03-11 21:32 UTC] jani@php.net
Note: In _both_ files!
 [2008-03-19 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Sep 28 23:01:27 2024 UTC