12 Replies - 2668 Views - Last Post: 30 March 2005 - 11:30 AM Rate Topic: -----

#1 INeedAGig1210  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 27-March 05

User Account - User Upload

Posted 27 March 2005 - 05:51 PM

I am interested in creating this for my site.

How would I go about programming this on my site.

I want users to be able to create and be able to login to there own personal account on my site and be able to upload files, say pictures, to there own designated folder in there account. How do I program this?


All help is appreciated, I have no idea where to start for this type of thing, I've never had to do it before.

Is This A Good Question/Topic? 0
  • +

Replies To: User Account - User Upload

#2 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,506
  • Joined: 12-July 02

Re: User Account - User Upload

Posted 27 March 2005 - 09:06 PM

Well, you didn't mention what scripting languages or databases your host supports, so I'll try and keep it general.

You should design a database, and the first table in it can be a simple one...holding a username and password for registered users, along with any other information you wish to keep for a user.

When a user registers, in addition to saving their information, you can also program a script to create a folder named after their username, where any uploads they have can be stored. Another option is to have just one area for uploads, and another table in the database that stores a relationship between username and filename. In this manner, when a user was logged in, you'd display only the files associated to their username (of course, you'd have to take into consideration files with the same name uploaded by different users in that scenario).

File uploaders are easy to program, in fact there are many available for free...but again, this would depend on the scripting language you were using.

Without further information about languages and db setups, it's a little hard to offer more.
Was This Post Helpful? 0
  • +
  • -

#3 INeedAGig1210  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 27-March 05

Re: User Account - User Upload

Posted 28 March 2005 - 08:15 AM

Well, my host supports MySQL, PHP, CSS, Java, and all the standard HTML, DHTML....yada yada.


The thing though, is I don't know how to program a complex thing like this. I don't know where to start to program a database for something like this from scratch, please help! :)
Was This Post Helpful? 0
  • +
  • -

#4 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,506
  • Joined: 12-July 02

Re: User Account - User Upload

Posted 28 March 2005 - 09:12 AM

Well php and mysql will certainly do the trick...since you mentioned some inexperience (and no offence intended), do you have the knowledge to make a basic html registration form? One that takes in any information you wish to keep regarding your registered users? As for the database, does your host provide you with an admin panel (along the lines of phpMyAdmin)? If so, you can create the tables through a web based graphical interface.

First thing to decide is what information you want to capture about the people registering. Just the username and password, or something more?

You may wish to program this from scratch, or use an existing script, some of which can be found here, and here, as well as a multitude of other script sites.

If you decide to create a directory for each user, you'll simply need to use the mkdir() command once you've recorded their username.
Was This Post Helpful? 0
  • +
  • -

#5 INeedAGig1210  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 27-March 05

Re: User Account - User Upload

Posted 28 March 2005 - 08:42 PM

Well, I have never made a registration form from scratch, nor needed to. I do have phpMyAdmin on my server.


All the information I need to collect would be, there name, e-mail address, username, password, and which service they would like. I have 3 services available which is the free basic, pay standard, and pay plus. And payment will be collected through paypal. This is an Image Hosting service I am making for my site.

When there account is created I would have a log-in area to get to their account, where they would be able to upload files to their very own directory inside of the service level they chose directory.

Thanks for the help so far. Where should I start to do this?

This post has been edited by INeedAGig1210: 28 March 2005 - 09:00 PM

Was This Post Helpful? 0
  • +
  • -

#6 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,506
  • Joined: 12-July 02

Re: User Account - User Upload

Posted 29 March 2005 - 07:21 AM

I'd say a good place to start would be the registration page. It can contain information about the packages, and the form required to register, something like:
<form action="submitthis.php" method="post">
<table>
<tr><td>Name:<input type="text" name="username" id="username"/></td></tr>
<tr><td>Password:<input type="password" name="pass" id="pass"/></td></tr>
<tr><td><select name="Service">
              <option value="option1">Option1</option>
              <option value="option2">Option2</option>
              <option value="option3">Option3</option>
              </select>
</td></tr>
<tr><td><input type="submit" name="submit" value="Register Now" /></td></tr>
</table>
</form>


Here is a page that explains some of the more common tags and their uses. The form above would submit information to a page called submitthis.php, where it would have to be processed (entered in the database).

As for the database itself, create a table with all of the fields you want to record (and maybe a primary key as well, they are often useful).

Then you can proceed with writing the script to enter the information in the database.
Was This Post Helpful? 0
  • +
  • -

#7 INeedAGig1210  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 27-March 05

Re: User Account - User Upload

Posted 29 March 2005 - 09:32 AM

Alright. I got a registration page setup, but when it goes to the php page I created for it to submit to, it just shows a blank white page.

Also, I've never programed my own database before, how do I make the tables and the script.


Thanks again.

This post has been edited by INeedAGig1210: 29 March 2005 - 09:45 AM

Was This Post Helpful? 0
  • +
  • -

#8 DanceInstructor  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 0
  • View blog
  • Posts: 41
  • Joined: 18-March 05

Re: User Account - User Upload

Posted 29 March 2005 - 12:07 PM

The easiest way to create your db tables is using phpMyAdmin. Once you have created your db in the cpanel go to phpMyAdmin and choose your db. Then choose structure (top tab). Near the bottom of this page you will see "Create new table on database" Enter the name of your table, like maybe "user_data" or something. Also choose the number of fields (you can add or delete fields later). Then click go. On the next page the script will ask you to define the fields of your table. See the attachment for an example of field definitions. Then click save and you are done.

Attached image(s)

  • Attached Image

Was This Post Helpful? 0
  • +
  • -

#9 INeedAGig1210  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 27-March 05

Re: User Account - User Upload

Posted 30 March 2005 - 08:19 AM

Alright, I got the fields setup according to that image for now, what is the next step.
Was This Post Helpful? 0
  • +
  • -

#10 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,506
  • Joined: 12-July 02

Re: User Account - User Upload

Posted 30 March 2005 - 09:19 AM

Now you need to script the page that dies the submitting...you'll need to:
  • Connect to the database
  • Create an insert statement
  • Insert the data
  • Clean up.
Here is a short article that walks through the basics of php and mysql interaction. Your submit page will look similar to the insert example.

Please note that nothing has been mentioned about error checking and validating user input, but they are important factors in any script.
Was This Post Helpful? 0
  • +
  • -

#11 INeedAGig1210  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 27-March 05

Re: User Account - User Upload

Posted 30 March 2005 - 09:51 AM

Will that artical be useful for my image hosting though?

Whew boy...im confused... :blink:
Was This Post Helpful? 0
  • +
  • -

#12 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,506
  • Joined: 12-July 02

Re: User Account - User Upload

Posted 30 March 2005 - 10:10 AM

Well, it will be useful for displaying the images, but it was meant more from a perspective to familiarize you with general database and php interaction - specifically for the user registration part. For image hosting (like a photo gallery), you may be better off leveraging an exisiting script. I know there are some good ones out there.

Since you seem to be looking for a complete site design, it may be helpful for you to write a requirements document containing everything you need the site to do...it could prove to be avaluable asset either for yourself or someone who may be coding for you. With such a document, it's much easier to design modules to work exactly as you want them.
Was This Post Helpful? 0
  • +
  • -

#13 INeedAGig1210  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 27-March 05

Re: User Account - User Upload

Posted 30 March 2005 - 11:30 AM

Well, I don't need an entire site design. I just need an image hosting database setup, as I have no custom database building experience.


Basically I just need a database that will hold individual user accounts for users that are registered to upload there photo's and other images to their own photo library/gallery account on my site.

Like I explained earlier in this thread, I have one free hosting package, and two pay hosting packages. They will sign up on the registration form, it will submit to the database and create their personal folder within the package database they chose, upon each time they return to the site, they will be able to login to their image account to upload and manage their images.


Thanks for all the help so far, it's greatly appreciated.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1