Solved

PHP Notice:  Only variable references should be returned by reference

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
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 dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

911 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

23 Experts available now in Live!

Get 1:1 Help Now