You are here: Re: PHP file upload form « PHP Programming Language « IT news, forums, messages
Re: PHP file upload form

Posted by Jacob Lyles on 12/18/77 11:49

I think this is what you want:

<?php
$target_path = "./uploads/";
$target_path = $target_path .
basename($_FILES['uploadedfile']['name']);
move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path);
?>


It's a php page, so you don't want any html output. I'm assuming the
name of the files section of your form is "uploadedfile". Also, the
<form> tag should have the attribute
action="whatever_you_called_this_file.php". You really should learn how
these commands work using the PHP manual. Check out:


http://us3.php.net/manual/en/function.move-uploaded-file.php
http://us3.php.net/manual/en/features.file-upload.php


Both links offer great instruction and some tutorials.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация