Solved

PHP Notice:  Only variable references should be returned by reference

Posted on 2007-11-13
2
1,119 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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Thoughout my experience working on eCommerce web applications I have seen applications succumbing to increased user demand and throughput. With increased loads the response times started to spike, which leads to user frustration and lost sales. I ha…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

830 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