Solved

PHP Notice:  Only variable references should be returned by reference

Posted on 2007-11-13
2
1,115 Views
Last Modified: 2013-12-13
How do I fix this PHP notice?

Line the Error occurs on.
return $this->raiseError('BAD_FORM');

PHP Error Message
PHP Notice:  Only variable references should be returned by reference in C:\wamp\www\banners\libs\HTTP\Upload.php on line 386

The function that is getting the error.
function &_buildFiles()
{
    // Form method check
    if (!isset($this->content_type) ||
        strpos($this->content_type, 'multipart/form-data') !== 0)
    {
        return $this->raiseError('BAD_FORM');
    }
    // In 4.1 $_FILES isn't initialized when no uploads
    // XXX (cox) afaik, in >= 4.1 and <= 4.3 only
    if (function_exists('version_compare') &&
        version_compare(phpversion(), '4.1', 'ge'))
    {
        $error = $this->isMissing();
        if (PEAR::isError($error)) {
            return $error;
        }
    }

    // map error codes from 4.2.0 $_FILES['userfile']['error']
    if (function_exists('version_compare') &&
        version_compare(phpversion(), '4.2.0', 'ge')) {
        $uploadError = array(
            1 => 'TOO_LARGE',
            2 => 'TOO_LARGE',
            3 => 'PARTIAL',
            4 => 'NO_USER_FILE'
            );
}
0
Comment
Question by:taynet29
2 Comments
 
LVL 48

Accepted Solution

by:
hernst42 earned 500 total points
ID: 20275407
use:
$err = $this->raiseError('BAD_FORM');
return $err;

If you are using php5 you can remove the & from
function &_buildFiles()
and the erro should also vanish
0
 

Author Comment

by:taynet29
ID: 20275470
I am using php 5.0.  That was it.  Thanks for your help.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

If I have to fix slow responding website my first thoughts are server side optimizations: the database may not be optimized or caching is not enabled, or things like that. We often overlook another major part of our web application: the client. We o…
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
The viewer will learn how to count occurrences of each item in an array.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now