Profile - Create/Edit

Hi there!

I want my users to register and create a profile. Then be able to log in and be able to update their profile. It’s like a resume - adding new jobs, descriptions, etc.

I’m guessing it’s a lot of code, so too much to ask for in this forum section. But since it’s such a common section of a web site (a user’s profile), I was thinking that maybe there was some pre-made code out there or a tutorial that I could look at?

If so, could someone point me in that direction? It would basically be a way to create a profile, then edit the profile (from the user’s perspective).

And I’m happy to give further information if what I wrote isn’t clear .smile.

Thank you in advance for any help that you could give me!
Andrea

Depending on the complexity/time available you could consider using a framework



http://framework.zend.com/
etc

[hr]

If you want to do it on your own then I’d start with looking for some tutorials. Just do a search for “php pdo (or mysqli) user registration profile tutorial” and you will find lots. Just make sure they use parameterized queries (inserting ? or :variablename instead of $variable in queries)
ie
http://www.sunnytuts.com/post.php?idname=login-and-registration-with-object-oriented-php-and-pdo

I would recommend using the new password hashing functions
http://php.net/manual/en/function.password-hash.php

If you don’t have PHP > 5.5 you can use this which will give you the functionality

If you don’t have PHP > 5.3.7 I would recommend changing host. it was released over two years ago

Actually it’s really not that much code logic wise, it can be a lot of code depending on the amount of profile’s information that the user can enter.

Here’s just some pseudo-code in the logic:

if user is who they say they are then
User can add/edit their info
else
back to the home page you go

You would do this by checking their login information against the user’s database info.
The main thing to remember is to make it full proof where a person can’t see or edit another person’s information. Just a piece of advice if you are creating a profiling system have it where the person can’t edit their email (specially if you are using the email for verification purposes). Now, might sound counter-intuitive, but in the long run it will save the users as well as your butt’s bacon. :wink:

Ok, I kind of went a little off-topic :smiley:

I’m sure if you don’t want to go the framework route, that you can Google how to do a profiling system with PHP or even a third-party app?

I don’t know how much you know about PHP or where you are, but if you are learning anyway, look into the book Head First PHP MySQL. IIRC, they have a chapter on creating user profiles and a host of other topics… Just look else where for the database usage. A second version is coming out but, will be a while.

Sponsor our Newsletter | Privacy Policy | Terms of Service