There is no way to go. questions about how to submit and pass arrays in two steps of a form

Source: Internet
Author: User
There is no way to go. this post is about the problem of two-step form submission and passing arrays. at last, kiseki_m made an image upload function in step 2012-11-0916: 11: 45, on the home page, you can select multiple users through the checkbox interface. after selecting this option, click upload to go to the second upload page. there is no way to go. about the two-step submission of the form to pass the array
At the end of this post, kiseki_m edited the younger brother at 16:11:45 on to upload images. Multiple users can be selected on the home page through the checkbox, and then click upload to go to the second upload page, you can upload images to multiple user directories in batches, but now the problem arises. The first page uses the user ID array passed by the checkbox to go to the second page to upload images, which still exists at the beginning, however, after you click the "upload" button, that is, after submitting the second page, a foreach error will be prompted, which means the array does not exist ...... It seems that the session cannot be obtained ...... Help the ball ......



The second page, key page code:
 Session_start ();
Require_once ('Pic _ fns. php ');
Include ("upload. class. php ");


$ Edit_me = $ _ POST ['edit _ me']; // The Data selected by the checkbox is stored in the edit_me array.
$ Valid_user = $ _ SESSION ['valid _ user']; // checks whether a user logs on.

Do_html_header ("Upload image advertisement Upload pic for machine ");
Try {
Check_valid_user (); // checks whether to log on
} Catch (Exception $ e ){
Echo $ e-> getMessage ();
Do_html_url ('login _ admin. php', 'Return ');
Do_html_footer ();
Exit;
}

Foreach ($ edit_me as $ k) {// upload images cyclically. after submission, the data of WARNING foreach is empty.

If ($ _ POST ['submit ']) {// image Upload part
$ Image = new upload_image ();
$ Image-> get_file_dir ("pic/". $ k. "/"); // file storage directory
$ Image-> get_upload_name ($ _ FILES ['file'] ['name']);
$ Image-> get_upload_size ($ _ FILES ['file'] ['size']);
$ Image-> get_upload_type ($ _ FILES ['file'] ['type']);
$ Image-> get_upload_tamp ($ _ FILES ['file'] ['tmp _ name']);

$ Image-> upload ();
Display_user_menu ();
Do_html_footer;
}
}

?>



Display_user_menu ();
Do_html_footer;

?>


If you create a new array at the beginning of this page, you can upload images cyclically, but the passed array does not know why it doesn't work. please help me ......
------ Best solution --------------------

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.