Jump to content

[SOLVED] Editing Members Login Info


Xtremer360

Recommended Posts

<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>

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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>

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.