Xtremer360 Posted September 1, 2008 Share Posted September 1, 2008 <html> <head> <script type="text/javascript"> function showusername(str) { document.forms['change'].username.value = str; } </script> </head> <body> <?php // Connects to your Database $link = mysql_connect("?", "?", "?") or die(mysql_error()); mysql_select_db("?",$link) or die(mysql_error()); if (!mysql_select_db("?", $link)) { echo 'Could not select database'; exit; } ?> <center><table><tr><td>Member Username:</td><td> <?php echo "<select onchange=\"showusername(this.value)\">"; $data = mysql_query("SELECT username FROM members"); while($row = mysql_fetch_assoc($data)) echo '<option value="'.$row['username'].'">'.$row['username'].'</option>'; echo '</select>'; mysql_close(); ?> </td></tr></table></center> <center> <table border=1 cellpadding=5 cellspacing=0 width=350> <center><h2><span style="color: #CC0000">Edit a User</span></h2></center> <form name="change" action="editmember.php" method="post"> <tr><td>User Name:</td><td> <input type="text" name="username" maxlength="60" value="" /> </td></tr> <tr><td>Type:</td><td> <select name="type"> <option>Singles</option><option>Tag Team</option><option>Stable</option><option>Manager/Valet</option><option>Staff</option><option>Referee</option></select> </td></tr> <tr><td>Password:</td><td> <input type="password" name="pass" maxlength="10"> </td></tr> <tr><td>Confirm Password:</td><td> <input type="password" name="pass2" maxlength="10"> </td></tr> <tr><th colspan=2><input type="submit" name="editmember" value="Edit Member"></th></tr> </table> </form> </td> </tr> </table> </center> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/122167-solved-editing-members-login-info/ Share on other sites More sharing options...
pocobueno1388 Posted September 1, 2008 Share Posted September 1, 2008 The problem is? Quote Link to comment https://forums.phpfreaks.com/topic/122167-solved-editing-members-login-info/#findComment-630706 Share on other sites More sharing options...
Xtremer360 Posted September 1, 2008 Author Share Posted September 1, 2008 I don't know how to do this. Quote Link to comment https://forums.phpfreaks.com/topic/122167-solved-editing-members-login-info/#findComment-630707 Share on other sites More sharing options...
pocobueno1388 Posted September 1, 2008 Share Posted September 1, 2008 What don't you know how to do? You can't just post some code and expect everyone else to know what you need. You actually need to explain what your trying to do. Quote Link to comment https://forums.phpfreaks.com/topic/122167-solved-editing-members-login-info/#findComment-630736 Share on other sites More sharing options...
dezkit Posted September 1, 2008 Share Posted September 1, 2008 LOL, the OP is like 8 years old Quote Link to comment https://forums.phpfreaks.com/topic/122167-solved-editing-members-login-info/#findComment-630745 Share on other sites More sharing options...
Xtremer360 Posted September 1, 2008 Author Share Posted September 1, 2008 Oops I apologize I forgot to include the problem and just noticed it. I'm sorry. This script is a script that when an admin chooses a member username from the dropdown menu the username is put into the text box so that it can be entered. My question I want to know is how do I have it put the correct type of what's in the database and put in the passwords that are in database as well for editing. Quote Link to comment https://forums.phpfreaks.com/topic/122167-solved-editing-members-login-info/#findComment-631389 Share on other sites More sharing options...
ohdang888 Posted September 1, 2008 Share Posted September 1, 2008 Oops I apologize I forgot to include the problem and just noticed it. I'm sorry. This script is a script that when an admin chooses a member username from the dropdown menu the username is put into the text box so that it can be entered. My question I want to know is how do I have it put the correct type of what's in the database and put in the passwords that are in database as well for editing. this makes 0 sense Quote Link to comment https://forums.phpfreaks.com/topic/122167-solved-editing-members-login-info/#findComment-631419 Share on other sites More sharing options...
Xtremer360 Posted September 1, 2008 Author Share Posted September 1, 2008 The above script is a used by an admin to call all the usernames that are used to login to a control panel and it allows the admin to edit there login information. The admin can edit and the user's username, the type of user they are as well as their password. Upon submission of the script it will update the database with the user's updated information. The script is located at kansasoutlawwrestling.com/editmember.php. Does that part make sense so far? Quote Link to comment https://forums.phpfreaks.com/topic/122167-solved-editing-members-login-info/#findComment-631425 Share on other sites More sharing options...
ohdang888 Posted September 1, 2008 Share Posted September 1, 2008 use a mysql_query(""UPDATE table SET column = var , column2= var2) Quote Link to comment https://forums.phpfreaks.com/topic/122167-solved-editing-members-login-info/#findComment-631440 Share on other sites More sharing options...
Xtremer360 Posted September 1, 2008 Author Share Posted September 1, 2008 But how do I get it to place what the current values of the user inside the fields that I have there in the form. Quote Link to comment https://forums.phpfreaks.com/topic/122167-solved-editing-members-login-info/#findComment-631448 Share on other sites More sharing options...
DeanWhitehouse Posted September 1, 2008 Share Posted September 1, 2008 You want it to happen without loading? Then look at ajax If not just make it post on change , and that will get the details in the post, then you can edit. Quote Link to comment https://forums.phpfreaks.com/topic/122167-solved-editing-members-login-info/#findComment-631481 Share on other sites More sharing options...
Xtremer360 Posted September 1, 2008 Author Share Posted September 1, 2008 Yes I have it posting the username on change but how do I get it to post on a change the value of their user type when it's in a dropdown menu. Quote Link to comment https://forums.phpfreaks.com/topic/122167-solved-editing-members-login-info/#findComment-631483 Share on other sites More sharing options...
DeanWhitehouse Posted September 1, 2008 Share Posted September 1, 2008 Store it as the value Quote Link to comment https://forums.phpfreaks.com/topic/122167-solved-editing-members-login-info/#findComment-631486 Share on other sites More sharing options...
Xtremer360 Posted September 1, 2008 Author Share Posted September 1, 2008 I'm sorry can you explain what you mean by storing it as a value. Quote Link to comment https://forums.phpfreaks.com/topic/122167-solved-editing-members-login-info/#findComment-631488 Share on other sites More sharing options...
DeanWhitehouse Posted September 1, 2008 Share Posted September 1, 2008 in the drop down list <option value="VALUE(PHP thing here)">Option1</option > Quote Link to comment https://forums.phpfreaks.com/topic/122167-solved-editing-members-login-info/#findComment-631497 Share on other sites More sharing options...
Xtremer360 Posted September 1, 2008 Author Share Posted September 1, 2008 Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/122167-solved-editing-members-login-info/#findComment-631499 Share on other sites More sharing options...
slapdashgrim Posted September 1, 2008 Share Posted September 1, 2008 this is one i am working on it might give you some guidence. $results1 = mysql_query("SELECT * FROM users WHERE id='".$_POST['user']."'"); $user = mysql_fetch_array($results1); $results = mysql_query("SELECT * FROM usersinfo WHERE id='".$_POST['user']."'"); $info = mysql_fetch_array($results); ?> <table> <tr> <td colspan="2"> <center><h4>Edit <?print $user['username'];?>:</h4></center> <form method="post" action="handle.php"> </tr> <tr> <td>Username:</td> <td> <input type="text" name="username" value="<?print $user['username'];?>"> </td> </tr> <tr> <td> Admin: </td> <td> <input type="checkbox" <?if ($user['admin']==1){print'checked';}?> name="admin" value="1"> </td> </tr> <tr> <td> Set new Password: </td> <td> <input type="text" name="password"> </td> </tr> <tr> <td> Confirm Password: </td> <td> <input type="text" name="password1"> </td> </tr> <tr> <td> Email: </td> <td> <input type="text" name="email" value="<?print $info['email'];?>"> </td> </tr> <tr> <td> Gender: </td> <td> <select name="gender"> <option value="1" <?if($info['gender']==1){print'selected';}?>>Male</option> <option value="2" <?if($info['gender']==2){print'selected';}?>>Female</option> </select> </td> </tr> <tr> <td> Birthdate: </td> <td> <input type="text" name="birthdate" value="<?print $info['birthdate'];?>"> </td> </tr> <tr> <td colspan=2> <center> <input type="submit" name="submit" value="edit"> </center></td> </tr> </table> Quote Link to comment https://forums.phpfreaks.com/topic/122167-solved-editing-members-login-info/#findComment-631503 Share on other sites More sharing options...
DeanWhitehouse Posted September 1, 2008 Share Posted September 1, 2008 Its bad practice to use short tags. Also if the topic is solved, press topic solved at the bottom. Quote Link to comment https://forums.phpfreaks.com/topic/122167-solved-editing-members-login-info/#findComment-631507 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.