<?php
// File uploading with general php
if(isset($_FILE S['file'])) {
$file = $_FILES['file'] ;
//File properties
$file_name = $file['name'];
$file_tmp = $file['tmp_name '];
$file_size = $file['size'];
$file_error = $file['error'];
//Work out the file extension
$file_ext = explode('.', $file_name);
$file_ext = strtolower(end( $file_ext));
$allowed = array('jpg', 'gif');
if(in_array($fi le_ext, $allowed)) {
if($file_error= ==0) {
if($file_size<= 201552000) {
$file_destinati on = 'uploads/' . $file_name;
if(move_uploade d_file($file_tm p, $file_destinati on)) {
echo $file_destinati on;
}
}
}
}
}
?>
<h3>File upload</h3>
<form action="" method="post" enctype="multip art/form-data">
<input type="file" name="file">
<input type="submit" name="submit" value="UPLOAD">
</form>
__________________________________________________________________
__________________-------// File uploading with general php
if(isset($_FILE
$file = $_FILES['file']
//File properties
$file_name = $file['name'];
$file_tmp = $file['tmp_name
$file_size = $file['size'];
$file_error = $file['error'];
//Work out the file extension
$file_ext = explode('.', $file_name);
$file_ext = strtolower(end(
$allowed = array('jpg', 'gif');
if(in_array($fi
if($file_error=
if($file_size<=
$file_destinati
if(move_uploade
echo $file_destinati
}
}
}
}
}
?>
<h3>File upload</h3>
<form action="" method="post" enctype="multip
<input type="file" name="file">
<input type="submit" name="submit" value="UPLOAD">
</form>
__________________________________________________________________
<?php
// File uploading with general php
if(isset($_FILE S['file'])) {
$file = $_FILES['file'] ;
//File properties
$file_name = $file['name'];
$file_tmp = $file['tmp_name '];
$file_size = $file['size'];
$file_error = $file['error'];
//Work out the file extension
$file_ext = explode('.', $file_name);
$file_ext = strtolower(end( $file_ext));
$allowed = array('jpg', 'gif');
if(in_array($fi le_ext, $allowed)) {
if($file_error= ==0) {
if($file_size<= 201552000) {
$file_destinati on = 'uploads/' . $file_name;
if(move_uploade d_file($file_tm p, $file_destinati on)) {
echo $file_destinati on;
}
}
}
}
}
?>
<h3>File upload</h3>
<form action="" method="post" enctype="multip art/form-data">
<input type="file" name="file">
<input type="submit" name="submit" value="UPLOAD">
</form>
// File uploading with general php
if(isset($_FILE
$file = $_FILES['file']
//File properties
$file_name = $file['name'];
$file_tmp = $file['tmp_name
$file_size = $file['size'];
$file_error = $file['error'];
//Work out the file extension
$file_ext = explode('.', $file_name);
$file_ext = strtolower(end(
$allowed = array('jpg', 'gif');
if(in_array($fi
if($file_error=
if($file_size<=
$file_destinati
if(move_uploade
echo $file_destinati
}
}
}
}
}
?>
<h3>File upload</h3>
<form action="" method="post" enctype="multip
<input type="file" name="file">
<input type="submit" name="submit" value="UPLOAD">
</form>
</head>
<body>
<?php
if(isset($_POST
$email = $_POST['user_em
if(filter_var($
echo "<h2 class='valid'>Y
} else {
echo "<h2 class='invalid'
}
}
?>
<form method="post" action="">
<p><input type="text" name="user_emai
<input type="submit" name="submit" value="Submit">
</form>
</body>
</html>
No comments:
Post a Comment