Apache error from log file

Hi all,

I really need some help trying to figure out what this error means and how to resolve it. As stated in my Apache error log file.

[Sat Aug 13 20:29:38 2011] [error] [client] PHP Fatal error: Can’t use function return value in write context in C:\\Documents\\Cybertiger\\Projects\\server\\Apache2\\htdocs\\Scripts\\PHP\\Search Final\\results_8ykl1pw6pe.php on line 33

Any help would be greatly appreciated. :slight_smile:

Thanks in advance!

$5 says someone hacked your server and generated the results_[gibberish].php file which has an error.

Unfortunately, this isn’t on a web server yet. This is only being tested locally, and when I tried to test it (Dreamweaver CS3), it failed and Apache generated the error, as indicated in the first post.

Oh…and I think you owe someone $5 :wink:

What’s the code on line 33 of the file mentioned in the log (results_8ykl1pw6pe.php)?

This kind of stuff is often caused by the oft-made mistake of writing stuff like:

if(isset($_POST('my_variable'))) {

(note the parentheses for the $_POST array instead of square brackets)

^^ what Immerse said, or you’re using an old PHP version and doing something like

foreach (func_get_args() as $arg) {
  // do something

Old PHP versions don’t like that.

Salathe wrote an interesing post on it a while back, http://www.sitepoint.com/forums/php-34/cant-use-function-return-value-write-context-758144.html#post4880561

The referenced file is dynamically generated.

Let me explain how, perhaps it will help clear up any misunderstandings people are having.

So I have two files: form.php and results.php (results page for generating search results based on user input)

Viewing results.php in Live View in Dreamweaver causes the error to appear.

Everything is local.

Have a look at the attached image. While it is similiar in syntax/structure, the purpose for the code on line 33, as shown in the attached image is to provide test variables to see if the code works properly. My first guess is that it doesn’t like multiple “testing variables”?

Is 5.2.9 considered old already?! :eek:

I can provide a step-by-step of how I’m getting the error if anyone wants.

Let me know.

Here’s the problem:


isset() does not like functions as arguments. What you’d need to do is assign Request(“woo”) to variable, and then test that variable against, say, empty() or perhaps just test isset($_REQUEST[‘woo’]) instead.

Ok thanks, I’ll try that.

Thanks again for all the help!

Will post again if problems continue. :slight_smile: