matdemo159 0 Posted February 11, 2020 Report Share Posted February 11, 2020 Hello, I'm a total novice to HTML and am currently working on a really basic page: The user inputs a name into a form, and then based on their input, the page displays a series of images. Each character of the name corresponds to a different image output. My initial idea for this was to store the value of each character of the name into an array, and then sequentially output the corresponding images. However, I can't seem to find a way to store the input into an array, let alone one character at a time. Any help would be much appreciated! Quote Link to post Share on other sites
Makwana Prahlad 1 Posted April 1, 2020 Report Share Posted April 1, 2020 if(isset($_POST) and $_SERVER['REQUEST_METHOD'] == "POST"){ // Loop $_FILES to exeicute all files foreach ($_FILES['image1']['name'] as $f => $name) { if ($_FILES['image1']['error'][$f] == 0) { if ($_FILES['image1']['size'][$f] > $max_file_size) { $message[] = "$name is too large!."; continue; // Skip large files } elseif( ! in_array(pathinfo($name, PATHINFO_EXTENSION), $valid_formats) ){ $message[] = "$name is not a valid format"; continue; // Skip invalid file formats } else{ // No error found! Move uploaded files if(move_uploaded_file($_FILES["image1"]["tmp_name"][$f], $path.$name)) //Write insert query here. image name $_FILES["image1"]["name"][$f] } } } } Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.