Jump to content

creating a profile site need a little help


runnerjp

Recommended Posts

hey guys...

 

    i know how to enter data into database look it up and change it ect ect... what im wondering is how can i make it so each user gets there own page to come up with there profile on.... hard to explain but example

 

when you sign onto facebook your own profile comes onto the screen... is there away in which i can creat 1 page to fit all but user persific stuff will apear on page??

 

 

hope that makes sense... any websites point in directions anything will be helpfull.. as im new to this as much information a spossible would be nice also examples to follow... alot i know but i know you guys are the ones to ask :D

 

thankyou

Link to comment
Share on other sites

ok. What you could do is have the logon script that calls on a username and password from the database. This is to validate their logo details. In the table that stores the users details you should place an profile ID. This links the users indivdual profile page to them.

 

Once logged in you redirect the user to a new page. In this page you can use the POST method to get the users details and then use them to display there profile via a query on the database using the users details.

 

I hope this makes sense

 

 

 

Link to comment
Share on other sites

when a new user registers you will set your script up to automatically add there details to the logon table and add an default profile to the profile database. This default profile will be the bear basics of a profile page i.e title and description. You wont need two databases. Just one database with two tables, like below

 

Table 1 ~ User

User ID

Username

Password

Name

Profile id

 

Table 2 ~ Profile

Profile ID

Title

Description

Link to comment
Share on other sites

This is very possible, as you already know...

 

Can you do it? Well, if you have nothing so far, it might not be looking good... you're talking about an extremely complicated setup (anything on a per-user basis gets complicated fast).

 

Anyways, there's probably at least 100 ways to approach this. I would search the 'net for a starter script that kind of does what you want, or even just a portion of what you want, then start modifying it.

 

I've got to be honest with some of you guys sooner or later... taking on projects this large is just not practical. You will burn out and maybe even eventually quit coding all together. When you learn to be an engineer, do you jump right in and try to build a fully-functional bridge across a river? No, you gotta start small...

 

You have to 'code within your means', and challenge yourself little bits at a time to increase your knowledge. Again, I'm being honest here... something like Facebook was coded by a TEAM of people, not one dude hanging out in his bedroom. I love helping new coders learn things and move up the ladder, but on the other hand, I hate seeing guys be unrealistic and end up burnt out.

 

You would do yourself the biggest favor by downloading other people's scripts and modifying them. You learn very quickly that way. You cannot code from scratch without a vast base of knowledge. With all that in mind, I'm sure quite a few will jump in with a few ideas, so good luck with it!

 

PhREEEk

Link to comment
Share on other sites

thanks i have took on the ideas ...

 

i did think about phreeek's idea of downloading someones script and editing them.... the only problem with this is that i can find any scripts to edit lol... if any 1 can add to ideas with where i can find scripts that i can chnage to suit my needs please add it here :D

Link to comment
Share on other sites

If your users are logged in already, its simple. Query the database for information related to a users id. eg;

 

<?php

 // connect to db here.
 
 session_start();

 if (isset($_SESSION['userid'])) {
   $id = $_SESSION['userid'];
   $sql = "SELECT id, uname, moredetail, email FROM users WHERE memberID = '$id' LIMIT 1";
   if ($result = mysql_query($sql)) {
     if (mysql_num_rows($result)) {
       $row = mysql_fetch_assoc($result);
       echo $row['id'].'<br />';
       echo $row['uname'].'<br />';
       echo $row['moredetail'].'<br />';
       echo $row['email'].'<br />';
     }
   }
 }

?>

 

Done.

 

A big part of learning to program is learning to think logically. One big problem can usually be broken down into lots of smaller problems.

 

If you want your users to be able to edit there details you'll need.

 

* A page which displays the users details (retrieved via a session, as above) within a form.

* A page that processes any changes users made via the above form.

 

Its really not that hard.

 

PS: The code above is pretty much taken verbatim from the link I posted a few replies ago. I just made it select via a session variable rather than an id passed via the url.

Link to comment
Share on other sites

A big part of learning to program is learning to think logically. One big problem can usually be broken down into lots of smaller problems.

 

Bingo. Sometimes it's the hardest thing to put into English words as to why a project may be over a programmer's head, but the concept of what 'modules' the project consists of, is either there or isn't. Any site that is going to be public and developed specifically for public use and modification is going to need some VERY tedious modules and attention to details. Security and site searching spring to mind. Two things that are infinitely BORING to program, yet without them, the site would never flourish.

 

I don't know how a lot of the other pro scripters around here really got their wheels rolling, but in my case, I involved myself with open source projects and worked on the specific modules that were needed. I analyzed other modules that were written by other team members and learned even more. Starting an ambitious project from scratch would run you into wall after wall after wall, eventually really nailing you against something you simply could never achieve (this is oh so prevalent once it becomes time to concentrate on security!).

 

You could start a project like this, get ultimately completely frustrated and dejected, or take my suggestion... Look around for open source projects. Download their filesystem and start digesting parts of it. Join their tech support effort and begin answering questions about the software to the users. The user's questions will make you jump into the code and find the answer for them. Users will request modifications. You will learn to jump into the code and make those modifications. Before you know it, a few months down the road, the team may approve you as a coding member.

 

If you did your project for a year, you would be burned out and not have anything NEAR a working and secure site.

If you did what I suggested for a year, you would be a very accomplished software tech.

 

You can work on your 'dream project' on the side, and successes or failures won't really matter. You'll get all the satisfaction you need from working with a team on a valid and working project. Bonus! You'll have a bunch of coders as friends who will help you with your personal project! Well again, best of luck with whichever path you choose.

 

PhREEEk

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.