Jump to content

Recommended Posts

  Hello all, I have been using a simple php script for the past 3 years to calculate points for a gaming guild i am in,it has worked perfectly for 3 years then 3 weeks ago it just quit working properly, then script had been untouched for 2 years and then only the database was purged of old information. here is a link to the script packaged in a rar  lnrguild.com/points/points.rar  and a link to the working site lnrguild.com/points  any help would be much appreciated

Link to comment
https://forums.phpfreaks.com/topic/86773-help-me-please/
Share on other sites

You can look at your php.ini file to see if it's off and turn it on and see if it works.

 

An example would be something like, you have a URL that has www.mysite.com/index.php?page=news

 

Then you look at your code for index.php and notice

 

<?php
echo $page;
?>

 

Notice how we didn't define $page and we didn't use $_GET['page'] to set the variable.

Link to comment
https://forums.phpfreaks.com/topic/86773-help-me-please/#findComment-443500
Share on other sites

that doesn't appear to be the case,im going to include the code for the main page,

 

<? 
ob_start();
session_start();
require ('includes/mysql_connect.php');   


if($_GET['action'] == "Members"){
echo '<font size=4>Guild Member Points Listings</font><BR>';
echo '<font color="red">***Lifetime Points are not for Auctions, they are a total of all points ever earned.</font>';
echo '<table width="490" border="1" bordercolor="000652" cellpadding="0" cellspacing="0" class="tablebg">' . "\n";
echo '<tr align="center" valign="middle" bgcolor="#090090"><td width="200" height="20"><b>Name</b></td>' . "\n";
echo '<td width="100">Rank</td><td width="100">Activity</td><td width="70">Currently</td><td width="60">Lifetime</td></tr>' . "\n";

$mani = mysql_query("SELECT * FROM `guild_members` where Rank != 'Ex-Member' ORDER BY `Name` asc LIMIT 0, 1000") or die("Could not connect to database"); 
while ($members = mysql_fetch_array($mani, MYSQL_BOTH)) {
$total = $members[pts] + $members[usedpts];
echo '<tr align="center" valign="middle"><td width="200" class="names"><b>'.$members[Name].'</b></td>' . "\n";
echo '<td width="100">'.$members[Rank].'</td><td width="100">'.$members[Activity].'</td>' . "\n";
echo '<td width="70" bgcolor="#002253">'.$members[pts].'</td><td width="60">'.$total.'</td></tr>' . "\n";
}
echo '</table><BR><BR><br>' . "\n";

$query = "SELECT * FROM `guild_members` where Rank = 'Ex-Member' ORDER BY `pts` DESC LIMIT 0, 100"; 
$result = mysql_query ($query);
if (mysql_num_rows($result) != 0) {

echo '<table width="490" border="1" bordercolor="000652" cellpadding="0" cellspacing="0" class="tablebg">' . "\n";
echo '<tr align="center" valign="middle" bgcolor="#090090"><td width="200" height="20"><b>Name</b></td>' . "\n";
echo '<td width="100">Rank</td><td width="100">Activity</td><td width="70">Currently</td><td width="60">Lifetime</td></tr>' . "\n";

$mani = mysql_query("SELECT * FROM `guild_members` where Rank = 'Ex-Member' ORDER BY `pts` DESC LIMIT 0, 100") or die("Could not connect to database"); 
while ($members = mysql_fetch_array($mani, MYSQL_BOTH)) {
$total = $members[pts] + $members[usedpts];
echo '<tr align="center" valign="middle"><td width="200" class="names"><b>'.$members[Name].'</b></td>' . "\n";
echo '<td width="100">'.$members[Rank].'</td><td width="100">'.$members[Activity].'</td>' . "\n";
echo '<td width="70" bgcolor="#002253">'.$members[pts].'</td><td width="60">'.$total.'</td></tr>' . "\n";
}
echo '</table><BR><BR><br>' . "\n";
} }

if($_GET['action'] == "Pts"){
if (!isset($_SESSION['Fname']) AND (substr($_SERVER['PHP_SELF'], -10) != 'logout.php')) { 
header ("Location: http://" . LINK . "adminlogin.php"); }

echo '<font size="4">Spawn Posting</font><BR>Please choose your spawn and check who was there.<BR>'; ?>

<form method="post" action="<? $_SERVER['PHP_SELF']; ?>?action=Ptssub">

<?
echo 'Spawn:<SELECT name="spawnname" value="">';
echo '<option value="">Choose Boss</option>';
echo '<option value="Barracoon">Barracoon</option>';
echo '<option value="Neira">Neira</option>';
echo '<option value="Rikktor">Rikktor</option>';
echo '<option value="Semidar">Semidar</option>';
echo '<option value="Mephisto">Mephisto</option>';
echo '<option value="Lord Oaks">Lord Oaks</option>';
echo '<option value="Harrower">Harrower</option></select>';

echo '<SELECT name="spawnlocation" value="">';
echo '<option value="">Choose Location</option>';
echo '<option value="Despise">Despise</option>';
echo '<option value="Destard">Destard</option>';
echo '<option value="Deceit">Deceit</option>';
echo '<option value="Shame">Shame</option>';
echo '<option value="Tera Keep">Tera Keep</option>';
echo '<option value="Oaks">Oaks</option>';
echo '<option value="COD">City of the Dead</option>';
echo '<option value="Damwin">Damwin</option>';
echo '<option value="Marble">Marble</option>';
echo '<option value="Tortise">Tortise</option>';
echo '<option value="Ice West">Ice West</option>';
echo '<option value="Ice East">Ice East</option>';
echo '<option value="Island">Sanc Island</option>';
echo '<option value="Hoppers Bog">Hoppers Bog</option>';
echo '<option value="Kaldun">Kaldun</option>';
echo '<option value="Desert">Desert</option>';
echo '<option value="Oasis">Oasis</option></select>';
echo '<input type="text" name="spawndesc" value="" size="30"> <font color="gray">'.$Rdate.'</font>' . "\n";

echo '<table width="400" border="1" bordercolor="000652" cellpadding="0" cellspacing="0" class="tablebg">' . "\n";
echo '<tr align="center" valign="middle"><td colspan="5" width="400" height="20"><b>Points Given</b><BR></td></tr>' . "\n";
echo '<tr><td width="80"><input type="checkbox" name="spawnvalue" value="1">1 Pt</td>
<td width="80"><input type="checkbox" name="spawnvalue" value="2">2 Pt</td>
<td width="80"><input type="checkbox" name="spawnvalue" value="3">3 Pt</td>' . "\n";
echo '<td width="80"><input type="checkbox" name="spawnvalue" value="4">4 Pt</td>' . "\n";
echo '<td width="80"><input type="checkbox" name="spawnvalue" value="5">5 Pt</td>' . "\n";
echo '<td width="80"><input type="checkbox" name="spawnvalue" value="6">6 Pt</td>' . "\n";
echo '<td width="80"><input type="checkbox" name="spawnvalue" value="7">7 Pt</td>' . "\n";
echo '<td width="80"><input type="checkbox" name="spawnvalue" value="8">8 Pt</td>' . "\n";
echo '<td width="80"><input type="checkbox" name="spawnvalue" value="9">9 Pt</td>' . "\n";
echo '<td width="80"><input type="checkbox" name="spawnvalue" value="10">10 Pt</td>' . "\n";
echo '</table><BR><BR>' . "\n";

echo 'Scout:<SELECT name="Scout" value="" class="forms">';
echo '<option value="None">None</option>';

$mani = mysql_query("SELECT * FROM `guild_members` ORDER BY `Name` ASC LIMIT 0, 1000") or die("Could not connect to database");
while ($guildlist = mysql_fetch_array($mani, MYSQL_BOTH)) {
echo '<option value="'.$guildlist[iD].'">'.$guildlist[Name].'</option>';
}
echo '<table width="440" border="1" bordercolor="000652" cellpadding="0" cellspacing="0" class="tablebg">' . "\n";
echo '<tr align="center" valign="middle" bgcolor="#090090"><td width="200" height="20"><b>Name</b></td>' . "\n";
echo '<td width="100">Rank</td><td width="60">Activity</td><td width="40">Pts.</td><td width="40">Check</td></tr>' . "\n";


$mani = mysql_query("SELECT * FROM `guild_members` ORDER BY `Name` ASC LIMIT 0, 1000") or die("Could not connect to database"); 
for ($i=1;$members = mysql_fetch_array($mani, MYSQL_BOTH);++$i) { 

echo '<tr align="center" valign="middle"><td width="200" class="names"><b>'.$members['Name'].'</b></td>' . "\n";
echo '<td width="100">'.$members['Rank'].'</td><td width="60">'.$members['Activity'].'</td><td width="40">'.$members['pts'].'</td>';
print '<td width="40"><input type="checkbox" name="checkbox[]" value="'.$members['ID'].'"><input type="hidden" name="checkedmembers[]" value"'.$members['Name'].'">
<input type="hidden" name="ID" value"'.$members['ID'].'"></td></tr>' . "\n";

}mysql_close(); 

echo '</table><BR><BR>' . "\n";



echo '<input type="submit" value="Update" name="submits"><br /></form><br />';

}



if($_GET['action'] == "Ptssub"){
if (!isset($_SESSION['Fname']) AND (substr($_SERVER['PHP_SELF'], -10) != 'logout.php')) { 
header ("Location: http://" . LINK . "adminlogin.php"); }

if(empty($spawnvalue) || empty($spawndesc) || empty($spawnlocation)) die("Field left Blank");
if (isset($_POST['submits'])) {

if (isset($_POST['checkbox'])) {
$names = NULL;
      foreach($_POST['checkbox'] as $key=>$val) { 
$mani = mysql_query("SELECT * FROM `guild_members` where ID = $val");
$result = mysql_query ($mani);
while($test = mysql_fetch_array($mani, MYSQL_BOTH)) {

$names .= "{$test['Name']}, ";
$blah = $test['pts'] + $_POST['spawnvalue'];     
$query = "UPDATE guild_members SET pts=$blah where ID = $val";   
$result = mysql_query ($query);
if ($result) { echo ''.$test['Name'].': +'.$_POST['spawnvalue'].'<Br>'; }    
    } 
  } 
$names = substr($names, 0, -2);
$checkbox = TRUE;

} else { $checkbox = NULL;  echo 'No checkboxes!<BR>'; exit (); }


$query = "SELECT * FROM `guild_members` where ID = '$Scout'";
$result = mysql_query ($query);
if (mysql_num_rows($result) != 0) {



$mani = mysql_query("SELECT * FROM `guild_members` where ID = '$Scout'");
$result = mysql_query ($mani);
while($test = mysql_fetch_array($mani, MYSQL_BOTH)) {
$numb = 3;
$point = $test['pts'] + $numb;  

$query = "UPDATE guild_members SET pts=$point where ID = '$Scout'";
$result = mysql_query ($query);  
if ($result) { echo "Scout: ".$test["Name"].""; }


$cmdstr = "insert into spawns(spawnname, spawnlocation, spawndesc, spawnvalue, Rdate, message, posted, Scout) values ('{$_POST['spawnname']}', '{$_POST['spawnlocation']}', '{$_POST['spawndesc']}', '{$_POST['spawnvalue']}', '$Rdate', '$names', '$_SESSION[Fname]', '{$test['Name']}')";
$result = mysql_query($cmdstr);
} } else {


$cmdstr = "insert into spawns(spawnname, spawnlocation, spawndesc, spawnvalue, Rdate, message, posted, Scout) values ('{$_POST['spawnname']}', '{$_POST['spawnlocation']}', '{$_POST['spawndesc']}', '{$_POST['spawnvalue']}', '$Rdate', '$names', '$_SESSION[Fname]', '{$_POST['Scout']}')";
$result = mysql_query($cmdstr);
if ($result) { echo "No Scout Was Rewarded!<BR><BR>"; } 

} }
mysql_close();
}

?>

 

 

Link to comment
https://forums.phpfreaks.com/topic/86773-help-me-please/#findComment-443509
Share on other sites

i realy dont know much about writing php scripts, just enough to install them and edit them a lil bit, the problem with the script is that there is a admin page that allows me to add points to multiple members by checking there name on a list, now when i sumbit it, the screen goes blank and doesnt update, i can also add members, manualy edit there info and this all still works fine

Link to comment
https://forums.phpfreaks.com/topic/86773-help-me-please/#findComment-443527
Share on other sites

this should be the section that sumbits the post

<? 
ob_start();
session_start();
require ('includes/mysql_connect.php');   


if($_GET['action'] == "Members"){
echo '<font size=4>Guild Member Points Listings</font><BR>';
echo '<font color="red">***Lifetime Points are not for Auctions, they are a total of all points ever earned.</font>';
echo '<table width="490" border="1" bordercolor="000652" cellpadding="0" cellspacing="0" class="tablebg">' . "\n";
echo '<tr align="center" valign="middle" bgcolor="#090090"><td width="200" height="20"><b>Name</b></td>' . "\n";
echo '<td width="100">Rank</td><td width="100">Activity</td><td width="70">Currently</td><td width="60">Lifetime</td></tr>' . "\n";

$mani = mysql_query("SELECT * FROM `guild_members` where Rank != 'Ex-Member' ORDER BY `Name` asc LIMIT 0, 1000") or die("Could not connect to database"); 
while ($members = mysql_fetch_array($mani, MYSQL_BOTH)) {
$total = $members[pts] + $members[usedpts];
echo '<tr align="center" valign="middle"><td width="200" class="names"><b>'.$members[Name].'</b></td>' . "\n";
echo '<td width="100">'.$members[Rank].'</td><td width="100">'.$members[Activity].'</td>' . "\n";
echo '<td width="70" bgcolor="#002253">'.$members[pts].'</td><td width="60">'.$total.'</td></tr>' . "\n";
}
echo '</table><BR><BR><br>' . "\n";

$query = "SELECT * FROM `guild_members` where Rank = 'Ex-Member' ORDER BY `pts` DESC LIMIT 0, 100"; 
$result = mysql_query ($query);
if (mysql_num_rows($result) != 0) {

echo '<table width="490" border="1" bordercolor="000652" cellpadding="0" cellspacing="0" class="tablebg">' . "\n";
echo '<tr align="center" valign="middle" bgcolor="#090090"><td width="200" height="20"><b>Name</b></td>' . "\n";
echo '<td width="100">Rank</td><td width="100">Activity</td><td width="70">Currently</td><td width="60">Lifetime</td></tr>' . "\n";

$mani = mysql_query("SELECT * FROM `guild_members` where Rank = 'Ex-Member' ORDER BY `pts` DESC LIMIT 0, 100") or die("Could not connect to database"); 
while ($members = mysql_fetch_array($mani, MYSQL_BOTH)) {
$total = $members[pts] + $members[usedpts];
echo '<tr align="center" valign="middle"><td width="200" class="names"><b>'.$members[Name].'</b></td>' . "\n";
echo '<td width="100">'.$members[Rank].'</td><td width="100">'.$members[Activity].'</td>' . "\n";
echo '<td width="70" bgcolor="#002253">'.$members[pts].'</td><td width="60">'.$total.'</td></tr>' . "\n";
}
echo '</table><BR><BR><br>' . "\n";
} }

if($_GET['action'] == "Pts"){
if (!isset($_SESSION['Fname']) AND (substr($_SERVER['PHP_SELF'], -10) != 'logout.php')) { 
header ("Location: http://" . LINK . "adminlogin.php"); }

echo '<font size="4">Spawn Posting</font><BR>Please choose your spawn and check who was there.<BR>'; ?>

<form method="post" action="<? $_SERVER['PHP_SELF']; ?>?action=Ptssub">

<?
echo 'Spawn:<SELECT name="spawnname" value="">';
echo '<option value="">Choose Boss</option>';
echo '<option value="Barracoon">Barracoon</option>';
echo '<option value="Neira">Neira</option>';
echo '<option value="Rikktor">Rikktor</option>';
echo '<option value="Semidar">Semidar</option>';
echo '<option value="Mephisto">Mephisto</option>';
echo '<option value="Lord Oaks">Lord Oaks</option>';
echo '<option value="Harrower">Harrower</option></select>';

echo '<SELECT name="spawnlocation" value="">';
echo '<option value="">Choose Location</option>';
echo '<option value="Despise">Despise</option>';
echo '<option value="Destard">Destard</option>';
echo '<option value="Deceit">Deceit</option>';
echo '<option value="Shame">Shame</option>';
echo '<option value="Tera Keep">Tera Keep</option>';
echo '<option value="Oaks">Oaks</option>';
echo '<option value="COD">City of the Dead</option>';
echo '<option value="Damwin">Damwin</option>';
echo '<option value="Marble">Marble</option>';
echo '<option value="Tortise">Tortise</option>';
echo '<option value="Ice West">Ice West</option>';
echo '<option value="Ice East">Ice East</option>';
echo '<option value="Island">Sanc Island</option>';
echo '<option value="Hoppers Bog">Hoppers Bog</option>';
echo '<option value="Kaldun">Kaldun</option>';
echo '<option value="Desert">Desert</option>';
echo '<option value="Oasis">Oasis</option></select>';
echo '<input type="text" name="spawndesc" value="" size="30"> <font color="gray">'.$Rdate.'</font>' . "\n";

echo '<table width="400" border="1" bordercolor="000652" cellpadding="0" cellspacing="0" class="tablebg">' . "\n";
echo '<tr align="center" valign="middle"><td colspan="5" width="400" height="20"><b>Points Given</b><BR></td></tr>' . "\n";
echo '<tr><td width="80"><input type="checkbox" name="spawnvalue" value="1">1 Pt</td>
<td width="80"><input type="checkbox" name="spawnvalue" value="2">2 Pt</td>
<td width="80"><input type="checkbox" name="spawnvalue" value="3">3 Pt</td>' . "\n";
echo '<td width="80"><input type="checkbox" name="spawnvalue" value="4">4 Pt</td>' . "\n";
echo '<td width="80"><input type="checkbox" name="spawnvalue" value="5">5 Pt</td>' . "\n";
echo '<td width="80"><input type="checkbox" name="spawnvalue" value="6">6 Pt</td>' . "\n";
echo '<td width="80"><input type="checkbox" name="spawnvalue" value="7">7 Pt</td>' . "\n";
echo '<td width="80"><input type="checkbox" name="spawnvalue" value="8">8 Pt</td>' . "\n";
echo '<td width="80"><input type="checkbox" name="spawnvalue" value="9">9 Pt</td>' . "\n";
echo '<td width="80"><input type="checkbox" name="spawnvalue" value="10">10 Pt</td>' . "\n";
echo '</table><BR><BR>' . "\n";

echo 'Scout:<SELECT name="Scout" value="" class="forms">';
echo '<option value="None">None</option>';

$mani = mysql_query("SELECT * FROM `guild_members` ORDER BY `Name` ASC LIMIT 0, 1000") or die("Could not connect to database");
while ($guildlist = mysql_fetch_array($mani, MYSQL_BOTH)) {
echo '<option value="'.$guildlist[iD].'">'.$guildlist[Name].'</option>';
}
echo '<table width="440" border="1" bordercolor="000652" cellpadding="0" cellspacing="0" class="tablebg">' . "\n";
echo '<tr align="center" valign="middle" bgcolor="#090090"><td width="200" height="20"><b>Name</b></td>' . "\n";
echo '<td width="100">Rank</td><td width="60">Activity</td><td width="40">Pts.</td><td width="40">Check</td></tr>' . "\n";


$mani = mysql_query("SELECT * FROM `guild_members` ORDER BY `Name` ASC LIMIT 0, 1000") or die("Could not connect to database"); 
for ($i=1;$members = mysql_fetch_array($mani, MYSQL_BOTH);++$i) { 

echo '<tr align="center" valign="middle"><td width="200" class="names"><b>'.$members['Name'].'</b></td>' . "\n";
echo '<td width="100">'.$members['Rank'].'</td><td width="60">'.$members['Activity'].'</td><td width="40">'.$members['pts'].'</td>';
print '<td width="40"><input type="checkbox" name="checkbox[]" value="'.$members['ID'].'"><input type="hidden" name="checkedmembers[]" value"'.$members['Name'].'">
<input type="hidden" name="ID" value"'.$members['ID'].'"></td></tr>' . "\n";

}mysql_close(); 

echo '</table><BR><BR>' . "\n";



echo '<input type="submit" value="Update" name="submits"><br /></form><br />';

}



if($_GET['action'] == "Ptssub"){
if (!isset($_SESSION['Fname']) AND (substr($_SERVER['PHP_SELF'], -10) != 'logout.php')) { 
header ("Location: http://" . LINK . "adminlogin.php"); }

if(empty($spawnvalue) || empty($spawndesc) || empty($spawnlocation)) die("Field left Blank");
if (isset($_POST['submits'])) {

if (isset($_POST['checkbox'])) {
$names = NULL;
      foreach($_POST['checkbox'] as $key=>$val) { 
$mani = mysql_query("SELECT * FROM `guild_members` where ID = $val");
$result = mysql_query ($mani);
while($test = mysql_fetch_array($mani, MYSQL_BOTH)) {

$names .= "{$test['Name']}, ";
$blah = $test['pts'] + $_POST['spawnvalue'];     
$query = "UPDATE guild_members SET pts=$blah where ID = $val";   
$result = mysql_query ($query);
if ($result) { echo ''.$test['Name'].': +'.$_POST['spawnvalue'].'<Br>'; }    
    } 
  } 
$names = substr($names, 0, -2);
$checkbox = TRUE;

} else { $checkbox = NULL;  echo 'No checkboxes!<BR>'; exit (); }


$query = "SELECT * FROM `guild_members` where ID = '$Scout'";
$result = mysql_query ($query);
if (mysql_num_rows($result) != 0) {



$mani = mysql_query("SELECT * FROM `guild_members` where ID = '$Scout'");
$result = mysql_query ($mani);
while($test = mysql_fetch_array($mani, MYSQL_BOTH)) {
$numb = 3;
$point = $test['pts'] + $numb;  

$query = "UPDATE guild_members SET pts=$point where ID = '$Scout'";
$result = mysql_query ($query);  
if ($result) { echo "Scout: ".$test["Name"].""; }


$cmdstr = "insert into spawns(spawnname, spawnlocation, spawndesc, spawnvalue, Rdate, message, posted, Scout) values ('{$_POST['spawnname']}', '{$_POST['spawnlocation']}', '{$_POST['spawndesc']}', '{$_POST['spawnvalue']}', '$Rdate', '$names', '$_SESSION[Fname]', '{$test['Name']}')";
$result = mysql_query($cmdstr);
} } else {


$cmdstr = "insert into spawns(spawnname, spawnlocation, spawndesc, spawnvalue, Rdate, message, posted, Scout) values ('{$_POST['spawnname']}', '{$_POST['spawnlocation']}', '{$_POST['spawndesc']}', '{$_POST['spawnvalue']}', '$Rdate', '$names', '$_SESSION[Fname]', '{$_POST['Scout']}')";
$result = mysql_query($cmdstr);
if ($result) { echo "No Scout Was Rewarded!<BR><BR>"; } 

} }
mysql_close();
}

?>

Link to comment
https://forums.phpfreaks.com/topic/86773-help-me-please/#findComment-444033
Share on other sites

actually i think this is it

 

<? 
ob_start();
session_start();
require ('includes/mysql_connect.php');

if($action == "Viewspawns") {
echo '<font size=4>Recent Spawn Listings</font>';
if ( $page == NULL || $page < 1 )
	$page = 1;

echo '<table border="1" bordercolor="000652" cellpadding="0" cellspacing="0" class="tablebg">' . "\n";
echo '<tr align="left" valign="top"><td>';
$mani = mysql_query("SELECT * FROM `spawns` ORDER BY `ID` DESC LIMIT ".(($page-1)*30).", 30") or die("Could not connect to database"); 
while ($erm = mysql_fetch_array($mani, MYSQL_BOTH)) {

#Admin edit check
if($_SESSION[Level] > 1) { echo '<a href="?action=Editspawn&id='.$erm['ID'].'"><font color="red">Edit</font></a> - '; }

echo '<a href="spawns.php?action=Displayspawn&id='.$erm['ID'].'">' . "\n";
echo ''.$erm['spawnname'].' | '.$erm['spawnlocation'].': '.$erm['spawndesc'].'</a> - '.$erm['Rdate'].'  '.$erm['Rtime'].'<BR>' . "\n";
}

$query = "SELECT * FROM `spawns`" or die("Could not connect to database"); 
$result = mysql_query ($query);

$totalfields = mysql_num_rows($result);
$totalpages = $totalfields / 30;
if ( $totalfields % 30 > 0 )
	$totalpages++;

echo '<BR><BR>Page: ';

for( $i = 1; $i <= $totalpages; $i++) {
	if ( $page != $i )
		echo '<a href="?action=Viewspawns&page='.$i.'">'.$i.'</a>';
	else
		echo $i;

	if ( $i < $totalpages )
		echo ' | ';
} exit();
}

echo '</td></tr></table>';
if($action == "Displayspawn"){
if ( $id == NULL || !is_numeric($id) || $id < 1 )
	$id = 1;

echo '<font size=4>Spawn Listings</font>';

$mani = mysql_query("SELECT * FROM `spawns` where `ID` = $id") or die("Could not connect to database"); 
$result = mysql_query($mani);
while ($erm = mysql_fetch_array($mani, MYSQL_BOTH)) {

echo '<table width="500" border="1" bordercolor="000652" cellpadding="0" cellspacing="0" class="tablebg">' . "\n";
echo '<tr align="left" valign="middle"><td width="500" height="20"  colspan="2"><b>Spawn:</b>'.$erm['spawnname'].' | '.$erm['spawnlocation'].': '.$erm['spawndesc'].'<BR></td>' . "\n";
echo '</tr><tr><td width="500" align="right"  colspan="2">'.$erm['Rdate'].'  '.$erm['Rtime'].'</td></tr>' . "\n";
echo '<tr><td width="250" align="left" valign="top">Scout: '.$erm['Scout'].' +1</td>' . "\n";
echo '<td width="250" align="right" valign="top">+'.$erm['spawnvalue'].' Spawn Pts</td></tr>' . "\n";
echo '<tr><td width="500" height="100" align="left" valign="top" colspan="2"><b>Attended:</b> '.$erm['message'].'</td></tr>';
echo '<tr><td width="500" align="right" valign="top" colspan="2"><b>Posted by:</b> '.$erm['posted'].'</td></tr>';
echo '</table><BR><BR>' . "\n";
}
exit(); 
}


if($action == "Editspawn"){
if (!isset($_SESSION['Fname']) AND (substr($_SERVER['PHP_SELF'], -10) != 'logout.php')) { 
header ("Location: http://" . LINK . "adminlogin.php"); }

if ( $id == NULL || !is_numeric($id) || $id < 1 )
	$id = 1;
if (isset($_POST['submit'])) {

$mani = mysql_query("SELECT * FROM `spawns` where `ID` = $id") or die("Could not connect to database"); 
$result = mysql_query($mani);
while ($erm = mysql_fetch_array($mani, MYSQL_BOTH)) {

$query = "UPDATE spawns SET spawnname='{$_POST['editname']}', spawndesc='{$_POST['editdesc']}', spawnvalue='{$_POST['editvalue']}', message='{$_POST['editmembers']}',  Scout='{$_POST['editscout']}', posted='{$_POST['editposted']}' where ID = '$id'";
$result = mysql_query ($query); 
}
echo '<BR><BR>-= Spawn edited and saved =-<BR>';
$mani = mysql_query("SELECT * FROM `spawns` where `ID` = $id") or die("Could not connect to database"); 
$result = mysql_query($mani);
while ($erm = mysql_fetch_array($mani, MYSQL_BOTH)) {
echo '<table width="400" border="1" bordercolor="000652" cellpadding="0" cellspacing="0" class="tablebg">' . "\n";
echo '<tr align="left" valign="middle"><td width="400" height="20"  colspan="2"><b>Spawn:</b>'.$erm['spawnname'].' - '.$erm['spawndesc'].'<BR></td>' . "\n";
echo '</tr><tr><td width="400" align="right"  colspan="2">'.$erm['Rdate'].'  '.$erm['Rtime'].'</td></tr>' . "\n";
echo '<tr><td width="200" align="left" valign="top">Scout: '.$erm['Scout'].' +1</td>' . "\n";
echo '<td width="200" align="right" valign="top">+'.$erm['spawnvalue'].' Spawn Pts</td></tr>' . "\n";
echo '<tr><td width="400" height="100" align="left" valign="top" colspan="2"><b>Attended:</b> '.$erm['message'].'</td></tr>';
echo '<tr><td width="400" align="right" valign="top" colspan="2"><b>Posted by:</b> '.$erm['posted'].'</td></tr>';
echo '</table><BR><BR>' . "\n";
}
exit();
}
$mani = mysql_query("SELECT * FROM `spawns` where `ID` = $id") or die("Could not connect to database"); 
$result = mysql_query($mani);
while ($erm = mysql_fetch_array($mani, MYSQL_BOTH)) {

echo '<font size=4>Spawn Listings</font>';
echo '<form action="spawns.php?action=Editspawn&id='.$id.'" method="post">';
echo '<table width="450" border="0" bordercolor="000652" cellpadding="0" cellspacing="0" class="tablebg">' . "\n";
echo '<tr align="right" valign="middle"><td width="450">';
echo 'Name:<input type="text" name="editname" value="'.$erm['spawnname'].'" size="20"><BR>' . "\n";
echo 'Description:<input type="text" name="editdesc" value="'.$erm['spawndesc'].'" size="20"><BR>' . "\n";
echo 'Points:<input type="text" name="editvalue" value="'.$erm['spawnvalue'].'" size="2"> ' . "\n";
echo 'Scout:<input type="text" name="editscout" value="'.$erm['Scout'].'" size="20"><BR>' . "\n";
echo 'Attended:<textarea name="editmembers" value="" cols="40" rows="6">'.$erm['message'].'</textarea><BR>' . "\n";
echo 'Posted by:<input type="text" name="editposted" value="'.$erm['posted'].'" size="20"><BR>' . "\n";

echo '<input type="submit" value="Edit" name="submit"><BR>';
echo '</td></tr></table>' . "\n";
}
exit(); 
}

exit();

?>

Link to comment
https://forums.phpfreaks.com/topic/86773-help-me-please/#findComment-444035
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.