[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 :)
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?
Re: Send array to class function
Quote:
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..
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?