Jump to content

Function name must be a string issue


max22

Recommended Posts

Does anyone see anything wrong with this code?  It's an image upload/thumbnail script.

I get a Function name must be a string error on the last line of the code:

 

Code snippet:

 

$ou = imagecreatetruecolor($w, $h);

imagealphablending($ou, false);

$funcall = "imagecreatefrom$imtype";

imagecopyresampled($ou, $funcall($fromfile), 0, 0, 0, 0, $w, $h, $img[0], $img[1]);

$funcall = "image$outype";

$funcall($ou, 'uploaded/cache/' . $_GET['w'] . '-' . md5($fromfile));

}

$funcall($ou);          <----------- This throws the error, can't figure out why.

 

Link to comment
Share on other sites

I tried moving the last line above the } because what you said makes perfect sense.  Sure enough, no error anymore. 

 

Thanks so much!  I'm new here, but this place is great, talk about fast answers!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.