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

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);
}
?>

146 Like 19 Dislike
Previous php-forum Next php-forum
Other php-forum

Automatic Webpage ??
I have a page www.mysite.com/test.php with a
<form>
<textarea name=&q

Page Reload
I am having issues getting a page to reload after I submit data to a database. This form should inp

Change Sort Order to Display Newest File First
Hi Guys,

I have a page that sorts the contents (PDFs) of a directory and displays them on the

PHP error on MySQL insert
I'm sure it's the simplest of issues, but I can't recall why this isn't working.

Code: [Selec

Need help PLEASE
ok i have this warning showing up

Warning: in_array() [function.in-array]: Wrong datatype for

Working with Dates, help.
Sooo to make a long story short, here's what im trying to accomplish.

I need to create a drop

quick basic question, hopefully not dumb
I don't know how to search for this, so forgive me if it's been covered...

I often see an exa

Alternate messaging
I have 4 strings in MySQL db1

$string1 : Hello
$string2 : Hi
$string3 : Great
$strin

post to self
Trying to get my form to submit to itself. However I am also trying to use an image for my submit bu

selectbox+database connection retrive problem
Code: [Select]
<tr>
<th align="left" scope="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