PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
ekosoftco
Forum Contributor
Posts: 108 Joined: Fri Aug 04, 2006 8:21 pm
Post
by ekosoftco » Wed Jan 10, 2007 10:45 am
ok this is what ive got so far, but no results still. Ive been trying at this for 3 days now,
Code: Select all
if($_GET['action'] == 'editmember')
{
// start the table, make headers
echo '<table class="style3"><tr><th>Username</th><th>Character Name</th><th>Option</th></tr>';
// fetch results from the DB
$result = mysql_query("SELECT * FROM loginphp WHERE Guild='{$_SESSION['Guild']}'") or die(mysql_error());
// print each row
while($row=mysql_fetch_assoc($result)){
echo '<tr style="background:#8ab4ff;">';
echo '<td>'.$row['Uname'].'</td>';
echo '<td>'.$row['Cname1'].'</td>';
echo '<td><FORM name=guidelinks method=post>
<SELECT name="guidelinks" ><OPTION SELECTED value="choose">--Choose--<OPTION name="makeadmin" value="makeadmin">Admin <OPTION name="makerecruiter" value="makerecruiter">Recruiter <OPTION name="deletemember" value="deletemember">Delete Member</SELECT>';
echo '<td><input type=submit value=Edit></td></FORM>';
echo '</tr>';
}
// close the table
echo '</table>';
}
if ($_POST["choice"] == "makeadmin")
{
$result = mysql_query("UPDATE guilds SET Admin='{$_SESSION['Uname']}' WHERE Tag = '{$_SESSION['Guild']}'") or die(mysql_error());
}
ive tried everything i could think of, doing an if(action = option name), if (post = option) and nothings worked so far
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Wed Jan 10, 2007 11:11 am
ekosoftco
Forum Contributor
Posts: 108 Joined: Fri Aug 04, 2006 8:21 pm
Post
by ekosoftco » Tue Jan 16, 2007 6:50 pm
ok, i tried a little different code, but no results still... its not updating in the table
Code: Select all
if($_GET['action'] == 'editmember')
{
// start the table, make headers
echo '<table class="style3"><tr><th>Username</th><th>Character Name</th><th>Option</th><th></th></tr>';
// fetch results from the DB
$result = mysql_query("SELECT * FROM loginphp WHERE Guild='{$_SESSION['Guild']}'") or die(mysql_error());
// print each row
while($row=mysql_fetch_assoc($result)){
echo '<tr style="background:#8ab4ff;">';
echo '<td>'.$row['Uname'].'</td>';
echo '<td>'.$row['Cname1'].'</td>';
echo '<td>';
echo "<form name=jump>";
echo "<select name=menu>";
echo "<option value=?action=makeadmin>Make Admin</option>";
echo "<option value=?action=makerecruiter>Make Recruiter</option>
<option value=?actiondeletemember>Delete Member</option>
</select></td><td>
<input type=button onClick=location=document.jump.menu.options[document.jump.menu.selectedIndex].value; value=Edit>
</form>";
echo '</td></tr>';
}
// close the table
echo '</table>';
}
if($_GET['action'] == 'makeadmin')
{
$result = mysql_query("UPDATE loginphp SET Rank= 'Admin' WHERE Guild = '{$_SESSION['Guild']}'") or die(mysql_error());
}
ekosoftco
Forum Contributor
Posts: 108 Joined: Fri Aug 04, 2006 8:21 pm
Post
by ekosoftco » Sun Jan 21, 2007 1:03 pm
I also have the code used for the buttons and the $_GET action on another page, to go to different actions so it will say different things when you select them, and it works fine, so i have no clue what the problem is for this one. x_X