Hello,
I want to create a php website which supports to upload files by admin, and which supports to attach images about the uploaded file.
I have been reading a lot of tutorials but no one is about what I need.
I'm novice into this, and I hope someone would be able to recommend me some tutorials about what I need.
Here is a site that I like: http://www.lianasims3.net/index.php
I don't want to copy this site, but I would like my site to have a similar system.
Thanks in advance.
File Uploading (Suggestions) !?!
Moderator: General Moderators
File Uploading (Suggestions) !?!
Last edited by xofter2 on Mon Apr 19, 2010 3:55 pm, edited 1 time in total.
- greyhoundcode
- Forum Regular
- Posts: 613
- Joined: Mon Feb 11, 2008 4:22 am
Re: Suggestions !?!
Can you clarify what you mean? If you want to facilitate the uploading of (any type of) files then try something as follows:xofter2 wrote:to upload files by admin, and which supports to attach images about the uploaded file.
Code: Select all
<?php
// Test if the file has been received
if ( (isset($_FILES['userfile'])) && ($_FILES['userfile']['error'] == UPLOAD_ERR_OK) )
{
// OK, now do something with the file
echo '<p>We have received the file.</p>';
}
elseif ( $_FILES['userfile']['error'] != UPLOAD_ERR_OK )
{
// There was a problem
echo 'Woops ... there was an error when dealing with this file.';
}
else
{
// Display the upload form
?>
<!-- It is important to set enctype to multipart! -->
<form method="post" action="testfile.php" enctype="multipart/form-data">
<input type="file" name="userfile" />
<input type="submit" value="Upload!" />
</form>
<?php
}
?>Re: Suggestions !?!
You asked for suggestions, mine is that you read our posting rules and change your Subject to describe what you really are asking for. General Subjects like "Suggestions (?)" are generally ignored by most of the people who might be able to help you. An appropriate Subject for your request might be "File uploading."
Re: File Uploading (Suggestions) !?!
I will test it soon, and I will get back if I'll need more indications.
The topic title has been changed to File Uploading.
Thank you.
The topic title has been changed to File Uploading.
Thank you.