Jump to content


Photo

HELP to create user profiles


  • Please log in to reply
18 replies to this topic

#1 rallokkcaz

rallokkcaz
  • Members
  • PipPipPip
  • Advanced Member
  • 194 posts
  • LocationSomewhere, CA (Cactus Area)

Posted 22 August 2006 - 06:56 AM

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!!

#2 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 22 August 2006 - 07:01 AM

Do you know how to insert and update a database? That would be a good place to start.

#3 rallokkcaz

rallokkcaz
  • Members
  • PipPipPip
  • Advanced Member
  • 194 posts
  • LocationSomewhere, CA (Cactus Area)

Posted 22 August 2006 - 07:03 AM

yes i do!!

#4 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 22 August 2006 - 07:05 AM

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?

#5 rallokkcaz

rallokkcaz
  • Members
  • PipPipPip
  • Advanced Member
  • 194 posts
  • LocationSomewhere, CA (Cactus Area)

Posted 22 August 2006 - 07:06 AM

i don't know how to do that!! ive got no clue how to make
a page like that.

#6 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 22 August 2006 - 07:13 AM

So you know how to insert and update data but not how to display it? An example...

<?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";
  }
?>

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.

#7 rallokkcaz

rallokkcaz
  • Members
  • PipPipPip
  • Advanced Member
  • 194 posts
  • LocationSomewhere, CA (Cactus Area)

Posted 22 August 2006 - 07:15 AM

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.


#8 rallokkcaz

rallokkcaz
  • Members
  • PipPipPip
  • Advanced Member
  • 194 posts
  • LocationSomewhere, CA (Cactus Area)

Posted 22 August 2006 - 07:18 AM

and also if i wanted to make this page
instantly when the user creates his account how would i do that?


#9 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 22 August 2006 - 07:19 AM

but how do you allow them to edit it


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.

make the page look a little more professinal.


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.

#10 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 22 August 2006 - 07:21 AM

and also if i wanted to make this page
instantly when the user creates his account how would i do that?


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.

#11 rallokkcaz

rallokkcaz
  • Members
  • PipPipPip
  • Advanced Member
  • 194 posts
  • LocationSomewhere, CA (Cactus Area)

Posted 22 August 2006 - 07:23 AM

srry bout that!! dumb question!
But how would you make an update sql statement.
srry for the dumb questions. :-\

#12 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 22 August 2006 - 07:27 AM

I thought you said you knew how to update a database? Maybe a read of this would help you.

#13 rallokkcaz

rallokkcaz
  • Members
  • PipPipPip
  • Advanced Member
  • 194 posts
  • LocationSomewhere, CA (Cactus Area)

Posted 22 August 2006 - 07:34 AM

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

#14 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 22 August 2006 - 07:35 AM

how could i make it so the user could edit it?


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

#15 rallokkcaz

rallokkcaz
  • Members
  • PipPipPip
  • Advanced Member
  • 194 posts
  • LocationSomewhere, CA (Cactus Area)

Posted 22 August 2006 - 07:38 AM

could you show an example? ???

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

#16 Yesideez

Yesideez
  • Members
  • PipPipPip
  • Advanced Member
  • 2,334 posts
  • LocationDevon, UK

Posted 22 August 2006 - 07:45 AM

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.
Not a pro just an enthusiast :)

if (empty($coffee)) {$coffee=new coffee();}

Please surround any code using the CODE tags - I rarely look at anything without them

#17 Yesideez

Yesideez
  • Members
  • PipPipPip
  • Advanced Member
  • 2,334 posts
  • LocationDevon, UK

Posted 22 August 2006 - 07:46 AM

If you want examples, you're more than welcome to download an MMPORG game I wrote last year:

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

Have a look at that and do what you want with it - I no longer use it.
Not a pro just an enthusiast :)

if (empty($coffee)) {$coffee=new coffee();}

Please surround any code using the CODE tags - I rarely look at anything without them

#18 CircularStopSign

CircularStopSign
  • Members
  • PipPipPip
  • Advanced Member
  • 44 posts

Posted 22 August 2006 - 10:15 PM

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?

#19 rallokkcaz

rallokkcaz
  • Members
  • PipPipPip
  • Advanced Member
  • 194 posts
  • LocationSomewhere, CA (Cactus Area)

Posted 23 August 2006 - 12:41 AM

yes thanks for putting it in better words




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users