Ad block is installed and active. Please support us by disabling it.
HomeMonday, November 20, 2017, 09:15:27
1

Upload File with PHP

Tuesday, February 10, 15, 13:27:18, 3 Yaers Ago Via wain, Hits: 3375
Basic file uploading with PHP
Example:

Code:
<?php
if(isset($_POST['Submit']))
{
$current_file=$_FILES['file']['name'];
$extension = substr(strrchr($current_file, '.'), 1);
if (($extension!= "txt") && ($extension != "zip"))
{
die('Unknown extension');
}
$time = date("fYhis");
$new_file = $time . "." . $extension;
$destination="uploads/".$new_file;
$action = copy($_FILES['file']['tmp_name'], $destination);
if (!$action)
{
die('File copy failed');
}else{
echo "File copy successful";
}
}else{
?>
<form method="post" enctype="multipart/form-data" action="submit.php">
<input type="file" name="file" ><br />
<input type="submit" name="Submit" value="submit">
</form>
<?php
}
?>

Sign In

Sponsor

Related

Math Captcha V6

PHP Math Captcha Image Version 6

Block Visitors From Specific IP Address

Learn How To Restrict Users From Different IP Addresses.

Creating a CAPTCHA with PHP with imagecreate

This tutorial will show you how to create a form with Captcha, Requirement(s): PHP Server, GD Graphics Library

How to insert new line (IP Address) with fwrite

How to insert new line (IP Address) with fwrite, Get IP address and write to file.

E-Cards 1.1. PHP Script

This script will allow your visitors to send e-cards to their friends. It features admin notification and HTML output.To use the "e-cards" script completely free , the "powered by" link at the bottom of the pages must stay intact.

PHP Redirect

Header (location) redirect must be processed before any output to the browser.

Comments 1.1. :: PHP Script

This script allows your visitors to add comments to any single page on your web site.

PHP File Create

Create and write data to a file using the php frwite function.

Creating a CAPTCHA with PHP :: PHP Tutorial

Captcha Image, This tutorial will show you how to create a form with Captcha.

Jquery - Formatting International Phone Numbers

How to format international telephone numbers with jquery
About Author

wain

Date Registered: Sun, Feb 8, 15
Last Time Online: Thu, Jun 15, 17
So far has created 115 entries.
wain
This author has not yet filled in any details.