Jump to content

Archived

This topic is now archived and is closed to further replies.

rallokkcaz

HELP to create user profiles

Recommended Posts

Ive searched the web for like 2 days now and still no strace of how to
make user profiles and let the user edit them.

someone pleeze help!!

it will be kind of you to help.


thank you!!

Share this post


Link to post
Share on other sites
Do you know how to insert and update a database? That would be a good place to start.

Share this post


Link to post
Share on other sites
Then insert the users data into a database, make a page to view said data and another to edit it. What part exactly are you stuck on?

Share this post


Link to post
Share on other sites
i don't know how to do that!! ive got no clue how to make
a page like that.

Share this post


Link to post
Share on other sites
So you know how to insert and update data but not how to display it? An example...

[code=php:0]
<?php
  // coonnect to database
  if (isset($_GET['uname'])) {
    $sql = "SELECT uname,location,age FROM users WHERE uname='{$_GET['uname']}'";
    if ($result = mysql_query($sql)) {
      $row = mysql_fetch_assoc($result);
      echo $row['uname']."</ br>";
      echo $row['location']."</ br>";
      echo $row['age']."</ br>";
    } else {
    echo "query failed ".mysql_error();
    }
  } else {
    echo "no user selected";
  }
?>
[/code]

If this file was called profiles.php and you called it using http://yoursite/profiles.php?uname=bob it would display bob's name location and age.

Share this post


Link to post
Share on other sites
ahhh.  :o  ;) that makes sense
thanks for that but how do you allow them to edit it
and make the page look a little more
professinal.

Share this post


Link to post
Share on other sites
and also if i wanted to make this page
instantly when the user creates his account how would i do that?

Share this post


Link to post
Share on other sites
[quote]but how do you allow them to edit it[/quote]

Make a simular page (called editprofile.php or something) but instead of just displaying the data, place it in a form ready to be submitted to an UPDATE sql statement.

[quote]make the page look a little more professinal.[/quote]

Use html to markup your data. What I posted was just a very simple example to get you started, Im not going to write a finished product.

Share this post


Link to post
Share on other sites
[quote]and also if i wanted to make this page
instantly when the user creates his account how would i do that?[/quote]

That makes no sense. If this page exists, then as soon as a user submits there details to the database you can use this page to display there profile.

Share this post


Link to post
Share on other sites
srry bout that!! dumb question!
But how would you make an update sql statement.
srry for the dumb questions. :-\

Share this post


Link to post
Share on other sites
I thought you said you knew how to update a database? Maybe a read of [url=http://www.hudzilla.org/phpbook/read.php/9_0_0]this[/url] would help you.

Share this post


Link to post
Share on other sites
ok ive got one question how could i make it so the user could edit it?
and do you have an msn or AIM screen name
so we could talk a little easier

Share this post


Link to post
Share on other sites
[quote]how could i make it so the user could edit it?[/quote]

I answered that question a few posts up. And no, I dont use any instant messenger.

Share this post


Link to post
Share on other sites
could you show an example? ???

ok im so srry for the trouble dude
but im a bit of a rush now

Share this post


Link to post
Share on other sites
Do a Google search for handling forms in HTML, there are loads of tutorials available or even visit scripts archives and download some examples, they'll show you exactly how its done.

Then its just a case of collecting the data in a PHP script using $_POST and inserting it all into the database.

Its like a register page when a user wants to sign up for whatever you're making. Once you have their registration details and its all correct you can insert it into a user's table in the database. Then whenever you use another script to view their profile all you're doing is extracting the data and displaying it in the browser.

Share this post


Link to post
Share on other sites
If you want examples, you're more than welcome to download an MMPORG game I wrote last year:

http://www.pictureinthesky.net/lealta.zip (1.5MB)

Have a look at that and do what you want with it - I no longer use it.

Share this post


Link to post
Share on other sites
i think hes talking about a publically viewed profile... for example myspace profiles.. which is what i'm trying to figure out.  i cant speak for him... but maybe he means how do you make it so that each  person has their own "www.mywebsite.com/*******" with the * as the digits of their user ID?

Share this post


Link to post
Share on other sites

×

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.