PHP script ends after > (not ?>) -


i got annoying error. after > script ends.

<html> <body>     <h1>upload file see previous upload!</h1>     <form action="index.php" method="post" enctype="multipart/form-data">         <label for="file">filename:</label>         <input type="file" name="file" id="file">     <br>     <input type="submit" name="submit" value="submit">     </form>     <?php             if (isset ($_files["file"])) {                 $allowedexts = array("jpeg", "jpg", "png");                 $temp = explode(".", $_files["file"]["name"]);                 $extension = end($temp);                 if ((($_files["file"]["type"] == "image/jpeg")                   || ($_files["file"]["type"] == "image/jpg")                   || ($_files["file"]["type"] == "image/pjpeg")                   || ($_files["file"]["type"] == "image/x-png")                   || ($_files["file"]["type"] == "image/png"))                   && ($_files["file"]["size"] < 1048576)                   && in_array($extension, $allowedexts)) {                     if ($_files["file"]["error"] > 0) {                         echo "error: couldn't upload file!";                     } else {                         move_uploaded_file($_files["file"]["tmp_name"], "files/" . $_files["file"]["name"]);                     }                 } else {                     echo "upload file nao!";                 }             }         ?> </body> </html> 

so on page can read this: "0) { echo "error: couldn't upload file!"; } else { move_uploaded_file($_files["file"]["tmp_name"], "files/" . $_files["file"]["name"]); } } else { echo "welcome!"; } } ?> "

well, guess what! not intention do... if can explain me why happening thankful.

php not being processed @ all. ensure page .php page , on php server. otherwise, ensure apache processing php whatever file extension using.

also, note more common use lowercase php in <?php instead of <?php, although appears capitalization doesn't matter.


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -