Jump to content

Archived

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

techiefreak05

user page editing ....

Recommended Posts

hi, i have a site where you can sign up, send messages, etc. and i also have a profile system ... BUT to edit your profile you have to build it from the ground up!! your page is EMPTY, how would i make it so they can edit snippets, like myspace??? take a look:

http://zycoworld.flamelicker.com

Share this post


Link to post
Share on other sites
how are you displaying the users information. If it is a simple form then you can do something like this.

[code=php:0]
$sql = mysql_query("SELECT * FROM `yourtable` WHERE `username` = '$username'") or die(mysql_error());

while ($rw = mysql_fetch_assoc($sql)) {
     //now we display a form with the users info in text boxes and areas.
     echo '<form action="your_edit.php?user_id=' . $rw['user_id'] .' method="post">
                Email : <input type="text" name="email" value="' . $rw['email'] . '">
                Some info: <textarea cols="50" rows="10">' . $rw['some_info'] . '</textarea>
                <input type="submit" name="submit" value="Update Profile">
             </form>';
}
[/code]

This is a realy simple way of doing this but it should give you an idea.

Also when you post a link you should make sure that it is a relivant link. Not just a link to your homepage.

Hope this helps,
Tom

Share this post


Link to post
Share on other sites
Well .. i have that. thats to edit your personal user account, i want something that you can edit certain pieces of www.mydomain.com/user.html .... like a myspace profile. i have something that works, but you have to edit the page all your self, there is noe template or anything... and i want there to be little snippets that you can edit, to edit your "profile" or user page

Share this post


Link to post
Share on other sites
I think that it would be better to use a database to store that and use a php page to display it.

So what I mean is something like this.
[code]
<?php
  $username = $_GET['username'];
?>
<html>
<title><?php echo "$username"; ?>'s personal page</title>
<body>
<?php
//now display there information
?>
</body>
</html>
[/code]

Then you could use something like what I posted before.

If you realy want to use an html page then you will need to read up on [url=http://us2.php.net/manual/en/function.fread.php]fread[/url] and fwrite. This is going to be alot more complicated.

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.