Jump to content

PHP + MySQL form questions


pedro84

Recommended Posts

Hi!

 

Wanna to add some features to my site and I'd like to ask if it's even possible.

 

I want to give my users opportunity to post their lists of their music.

 

So...I'd like to host eveyrthing in one table, in one record. I think I can do this, but I got problems with some  other things.

 

How to allow them editing this lists later? How to make, I don;t know how to call it, but after registration and submitting their list I'd like it to be accessible @ http://mysite.com/user_name  ?

 

Every help will be very appreciated!

 

 

Link to comment
Share on other sites

you can have the update page the same theres no need to have ?user=name ect for this..

 

try

 

<?php
$siteuser = $_SESSION["myusername"];
$query="SELECT * FROM `users` WHERE `username` = '$siteuser'";
$result=mysql_query($query) or die(mysql_error());
<?

 

Then have all of text fields or whatever you want for them to update what they had you can have it so it displays what they currently have for example:

 

<?php
$option1= mysql_result($result,$i,"option1");
$option2= mysql_result($result,$i,"option2");

//then echo what info is already in the DB in option 1 and option 2 into the text boxes

echo "
<input type=\"text\" name=\"myname\" maxlength=\"50\" size=\"20\" value=\"$option1\"> option 1<br>
<input type=\"text\" name=\"myage\" maxlength=\"50\" size=\"20\" value=\"$option2\"> option 2<br>
<p><input type=\"submit\" name=\"submit\" value=\"Submit\"></p>
</form>";
?>

 

then just use $_REQUEST and update the DB fields to what they change them to.

 

Hope it helps..

 

Rich

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.