Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
lab [2019/03/08 20:30]
fplmarques [Current Projects]
lab [2019/03/14 12:37]
fplmarques [Current Projects]
Line 34: Line 34:
 ====== Current Projects ====== ====== Current Projects ======
 \\ \\
-\\ +<​!DOCTYPE html> 
 +<​html>​ 
 +<​body>​ 
 + 
 <?php <?php
-   ​if(isset($_FILES['​image'​])){ +// This is a single-line comment
-      $errors= array(); +
-      $file_name = $_FILES['​image'​]['​name'​];​ +
-      $file_size =$_FILES['​image'​]['​size'​];​ +
-      $file_tmp =$_FILES['​image'​]['​tmp_name'​];​ +
-      $file_type=$_FILES['​image'​]['​type'​];​ +
-      $file_ext=strtolower(end(explode('​.',​$_FILES['​image'​]['​name'​])));​ +
-       +
-      $extensions= array("​jpeg","​jpg","​png"​);​ +
-       +
-      if(in_array($file_ext,​$extensions)=== false){ +
-         ​$errors[]="​extension not allowed, please choose a JPEG or PNG file.";​ +
-      } +
-       +
-      if($file_size > 2097152){ +
-         ​$errors[]='​File size must be excately 2 MB'; +
-      } +
-       +
-      if(empty($errors)==true){ +
-         ​move_uploaded_file($file_tmp,"​images/"​.$file_name);​ +
-         echo "​Success";​ +
-      }else{ +
-         ​print_r($errors);​ +
-      } +
-   } +
-?>+
  
-<​html>​ +# This is also a single-line comment 
-   <​body>​ + 
-       +/* 
-      <​form action=""​ method="​POST"​ enctype="​multipart/​form-data">​ +This is a multiple-lines comment block 
-         <input type="​file"​ name="​image" ​/> +that spans over multiple 
-         <input type="​submit"​/> +lines 
-      </​form+*
-       + 
-   ​</​body>​+// You can also use comments to leave out parts of a code line 
 +$x /* + 15 */ + 5; 
 +echo $x; 
 +?
 +  
 +</​body>​
 </​html>​ </​html>​