esercizi su form, php
This commit is contained in:
51
php7.php
Normal file
51
php7.php
Normal file
@@ -0,0 +1,51 @@
|
||||
|
||||
<?php
|
||||
|
||||
require_once ('functions.php');
|
||||
include('header.html');
|
||||
|
||||
///////////////////////////
|
||||
echo<<<_css
|
||||
|
||||
<style>
|
||||
|
||||
select {
|
||||
width:100px;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
_css;
|
||||
echo "\n";
|
||||
///////////////////////////
|
||||
|
||||
|
||||
if (count($_FILES)==0){
|
||||
|
||||
|
||||
echo "<form action=\"",$_SERVER['PHP_SELF'],"\" method=\"POST\" enctype=\"multipart/form-data\" > ";
|
||||
|
||||
echo "<input type=\"file\" name=\"gino\" >";
|
||||
|
||||
echo "<input type=\"submit\">";
|
||||
|
||||
echo "</form>";
|
||||
|
||||
}else {
|
||||
|
||||
|
||||
$file = $_FILES['gino']['name'];
|
||||
move_uploaded_file($_FILES['gino']['tmp_name'], $_SERVER["DOCUMENT_ROOT"]."uploaded/$file");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
include ('footer.html');
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user