Can I call a class inside a function?


Posted on 16th Feb 2014 07:03 pm by admin

I have a class written in another file that handles my image resizing.

Can I do this (php says I can't calling a non-existent class), but I know its there becuase the require doesn't fail above

Did you know?Explore Trending and Topic pages for more stories like this.
Code: [Select]<?php
<?php
require_once("image_load.php");
...
....

function image_upload($tmp_name,$imgid){

$image = new easyImageEdit();
$image->load(UPLOADS.$tmp_name);
$image->resizeToWidth(250);
}
?>
No comments posted yet

Your Answer:

Login to answer
146 Like 19 Dislike
Previous forums Next forums
Other forums

php form help
Hey,

I use a control file to set my meta tags and titles

Here's an example
Code: &a

add 20 000 to the rowcnt
Hi ...
I need to add 20 000 to the row count but just cant find a way to do this i am new to php

Relative path
I have a absolute path to an image - like so: C:/Program Files/Apache Software Foundation/Apache2.2/

Internal class functions don't seem to get executed.
Hi. Can someone please put me out of my misery on this. I don't write much PHP and this has me baffl

script and html conflict in trying to create a header.
I have an error is occurring because of an html webpage with a "php require" at the top of

Warning: mysql_num_rows() expects parameter 1
When i add quote at the end of this link
example:http://localhost/articlemania/category.php?cid=3

How can you detect variable string in a massive string?
Ok guys, i need some help with this one.

I am going to be getting a large string, like 10-20

Firewall / visited websites logger
Hi. I have a firewall implementation and I want to log all the websites visited on the machine. S

Allowing ' and "
Hello everyone,

I am creating a form where users submit information to go into a database. I

Help, Base64 encoding url and decoding server side.
Hello everyone, i have a website with videos and games and also provide an embed code which people c

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash