Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Leonvv

Privileged
  • Joined

  • Last visited

Solutions

  1. Leonvv's post in Simple Syntax question was marked as the answer   
    I hope that this does what you want:
    <?php $prefix = ""; $numberArray = ["zero", "one", "two", "three", "four", "five", "six", "seven"]; $someArray = array( 'label' => 'Select Home Score', 'desc' => 'Select home score', 'id' => $prefix . 'homescore-select', 'type' => 'select', 'options' => call_user_func(function(){ global $numberArray; $optionsArray = array(); // Loop through $numberArray. for($i = 0; $i < count($numberArray); $i++){ $optionsArray[$numberArray[$i]] = array( "label" => $i, "value" => $i ); } return $optionsArray; }) ); ?>  
    If you want more options you can just extend $numberArray.
     
    Léon
  2. Leonvv's post in Check if image field is empty was marked as the answer   
    Hey Row !
     
    Not sure if you're still struggling with this problem,
    but I got it working using the following code:
     
    <!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Upload Test</title> </head> <body> <?php if(isset($_FILES["upload"]) && !empty($_FILES["upload"])){ $imageCount = count($_FILES["upload"]["name"]); if($imageCount > 3){ // More than 4 images uploaded. echo "You can only upload 4 images."; } else if($imageCount == 1 && empty($_FILES["upload"]["name"][0])){ // No image uploaded. echo "No image selected."; } else{ $allowedExt = array("jpg", "jpeg", "png", "gif"); for($i = 0; $i < $imageCount; $i++){ $fileName = $_FILES["upload"]["name"][$i]; $fileSize = $_FILES["upload"]["size"][$i]; $extensionArray = explode('.', $fileName); if( !in_array(end($extensionArray), $allowedExt) ){ // Illegal extension. echo "Only jpg, jpeg, png, and gif are allowed."; break; } else if($fileSize > 2097152){ // File is too big. echo "Maximum allowed size is 2MB."; break; } else{ // Process the image. if(($i + 1) == $imageCount){ // Success message when the last image is processed. echo "Upload successful !"; } } } } } ?> <form action="" enctype="multipart/form-data" method="post"> <input type="file" name="upload[]" multiple="multiple" /> <br /> <input type="submit" value="Upload" /> </form> </body> </html>  
    Note the name of the input tag.
    Because of some reason I haven't figured out yet,
    it is necessary to write it in an "array notation" when using the "multiple" attribute otherwise only the last image is processed.
     
    Another ugly thing is that the $imageCount will be 1 if you don't upload any image.
    This is because $_FILES["upload"]["name"] will contain an empty array by default, for another mysterious reason...
     
    Hope it helps en succes !
    Léon
     
    Ps, multiple file upload is not fully supported yet.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.