How can I set up user accounts and an uploads section on my website?
February 25, 2011 by Action Warrior
Filed under aviation pictures
I am using Microsoft Front Page to create a resource website on aviation. People need to be able to create user accounts for themselves and also upload their own pictures and information.
Any ideas on how this can be set up please?
Cheers in advance





You will need to start programming in a server side scripting language like PHP or ASP. This sort of coding is not for the beginner and I am assuming you are a beginner because you use FP.
There are lots of programmers out there that have done this before and will be happy to help.
Yes, you will need a langauge like PHP and have a login database table set up with like rows as: id, uname, and pword.
I supplied two tutorials in my source.
First tutorial is how to create a login script with PHP, accessing MySQL.
The second tutorial is how to upload files with PHP.
Good Luck!
Your server must allow server-side scripts (php) and a database (mysql).
FrontPage is just a wysiwyg that won’t cope very well with these.
Set up a login script:
http://www.web2coders.com, free script “Login”.
For uploads:
UPLOADING FILES
The
type file will present a blank field and a “browse” button.
Clicking the browse button will allow the user to select a file to
upload.
Clicking the submit will submit the form to this same file.
Your “upfiles.php”:
function UploadOne($fname)
{
$uploaddir = 'uploadedfiles/';
if (is_uploaded_file($fname['tmp_name']))
{
$filname = basename($fname['name']);
$uploadfile = $uploaddir . basename($fname['name']);
if (move_uploaded_file ($fname['tmp_name'], $uploadfile))
$res = "File " . $filname . " was successfully uploaded and stored.
“;
else
$res = “Could not move “.$fname['tmp_name'].” to “.$uploadfile.”
“;
}
else
$res = “File “.$fname['name'].” failed to upload.”;
return ($res);
}
?>
< ?php
if ($_FILES['picture']['name'] != "")
{
$res = UploadOne($_FILES['picture']);
$filname = $_FILES['picture']['name'];
echo ($res);
}
?>
UPLOADING FILES
Finally: you must create a directory where to put the uploaded files, and that directory MUST have permissions set to 0777… (here called “uploadedfiles”)
(This set of functions works, but is NOT secure against viruses or “injection”: the prevention of these is a much more complicated matter!)