Solved

PHP Notice:  Only variable references should be returned by reference

Posted on 2007-11-13
2
1,124 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

635 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