Jump to content

user page editing ....


techiefreak05

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
Link to comment
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
Link to comment
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
Link to comment
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.
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.