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
https://forums.phpfreaks.com/topic/88379-php-mysql-form-questions/
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

Archived

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

×
×
  • 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.