|
-
Mar 14th, 2008, 12:26 PM
#1
Thread Starter
Frenzied Member
[RESOLVED] Send array to class function
Hello!
Heres what I am doing.
I have a form, it takes infor from use, including some images (important), it posts the variables back to the same page where they are picked up.
When this has been done before all the code is kept in the same page, but I am now going OOP and starting to use classes, its working really well, but it wont for some reason let me post the $_FILES['small_img'] to the class.
c0d
Code:
$product->setAddProduct($_POST['title'], $_POST['category'], $_POST['description'], $_POST['stock'], $_POST['price'], $_FILES['small_img'], $_FILES['large_img']);
Thanks
-
Mar 14th, 2008, 02:42 PM
#2
Thread Starter
Frenzied Member
Re: Send array to class function
Sorted! I just send the $_FILES and picked it up the other end.
Thanks Me! How do I rep myself?
-
Mar 14th, 2008, 05:49 PM
#3
Re: Send array to class function
 Originally Posted by I_Love_My_Vans
Sorted! I just send the $_FILES and picked it up the other end.
Thanks Me! How do I rep myself?
you can just give it the rep to me, if you want 
i didnt know you can send $_FILES to a class..
My usual boring signature: Something
-
Mar 15th, 2008, 03:27 AM
#4
Thread Starter
Frenzied Member
Re: [RESOLVED] Send array to class function
Well this is what I was using...
Code:
$product->setAddProduct($_POST['title'], $_POST['category'], $_POST['description'], $_POST['stock'], $_POST['price'], $_FILES['small_img'], $_FILES['large_img']);
But this is what worked... (NB! See code at very end of string)
Code:
$product->setAddProduct($_POST['title'], $_POST['category'], $_POST['description'], $_POST['stock'], $_POST['price'], $_FILES['small_img'], $_FILES;
I sent just $_FILES, and when in the class functon printed it using print_r and the entire array appeared as it would in the original file.
I wonder if this can be done with $_POST and $_GET, all they really are is arrays?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|