Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

PHP Notice:  Only variable references should be returned by reference

Posted on 2007-11-13
2
Medium Priority
?
1,126 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 2000 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.

688 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