Rifts Posted November 17, 2009 Share Posted November 17, 2009 OK I will try my best to explain what I'm trying to do. On my site there is a form. after a member submits the form I want the form with their answers to show up in their member/profile page.. I want the form to look the same except with their answers filled in and I want it like grayed out do you can not re-edit it. Does that make sense? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/181931-unsure-how-to-even-explain-this-about-a-form/ Share on other sites More sharing options...
premiso Posted November 17, 2009 Share Posted November 17, 2009 Do you have a database or how do you plan on storing the data? It is entirely possible, you just have to have a way to save the data so you can retrieve it when the members profile is pulled up. Quote Link to comment https://forums.phpfreaks.com/topic/181931-unsure-how-to-even-explain-this-about-a-form/#findComment-959588 Share on other sites More sharing options...
mikesta707 Posted November 17, 2009 Share Posted November 17, 2009 you disable a text box like so <input type="text" disabled="disabled" /> you can set the value of a text box like so <input type="text" value="<?php echo $myPHPValue; ?>" /> if you submit the form to the page where you want to show the disabled form, all you have to do is set the value to the corresponding post variables. if you submit them to a database, then you will have to pull the values from the database, and fill out the form Quote Link to comment https://forums.phpfreaks.com/topic/181931-unsure-how-to-even-explain-this-about-a-form/#findComment-959591 Share on other sites More sharing options...
Rifts Posted November 17, 2009 Author Share Posted November 17, 2009 oh yeah sorry I use a database php/mysql its all set up the form works and stores the data fine i just cant figure out the code to retrieve the data in the way i want Quote Link to comment https://forums.phpfreaks.com/topic/181931-unsure-how-to-even-explain-this-about-a-form/#findComment-959593 Share on other sites More sharing options...
mikesta707 Posted November 17, 2009 Share Posted November 17, 2009 well whatever data you want, just use a query. if I wanted to get the columns col1, col2, and col3 from the row where the id was 5, i would do $query = "SELECT col1, col2, col3 from table WHERE id=5"; $sql = mysql_query($query); $row = mysql_fetch_assoc($sql); //now I can access the values like so $row['col1'];//column 1 $row['col2'];//col2 //etc. Quote Link to comment https://forums.phpfreaks.com/topic/181931-unsure-how-to-even-explain-this-about-a-form/#findComment-959595 Share on other sites More sharing options...
Rifts Posted November 17, 2009 Author Share Posted November 17, 2009 ok i will play around with that... thanks... so do i need to copy the code for my form and then put php code inside the text boxes to pull the members data into it? Quote Link to comment https://forums.phpfreaks.com/topic/181931-unsure-how-to-even-explain-this-about-a-form/#findComment-959597 Share on other sites More sharing options...
mikesta707 Posted November 17, 2009 Share Posted November 17, 2009 uh sort of yes. I don't know what you mean by copy the code from your form, but in your new form you need to add some code to pull the data from your table, and populate the forms with that data Quote Link to comment https://forums.phpfreaks.com/topic/181931-unsure-how-to-even-explain-this-about-a-form/#findComment-959601 Share on other sites More sharing options...
Rifts Posted November 17, 2009 Author Share Posted November 17, 2009 Alright thanks to you I semi figured it out haha I can do the text boxes but I'm unsure of how to "re-check" the check boxes I have... in my database they are stored as either a 0 if unchecked or a 1 if checked so how do I recheck them in the copy of the form? thanks Quote Link to comment https://forums.phpfreaks.com/topic/181931-unsure-how-to-even-explain-this-about-a-form/#findComment-959625 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.