Paste what you last copied...

Page 16 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

Taggart

Diamond Member
Apr 23, 2001
4,384
0
0
102 Healthtronics Surgical GA 73 166 191 196
124 Manhattan Assoc GA 121 112 95 61
188 Serologicals
 

paruhd0x

Diamond Member
Apr 2, 2000
3,100
0
0
Anyone care to explain the problem? =p

This is what was in my clipboard....


<?
session_start();
//including session functions
include("/home/mc/public_html/includes/session.inc.php");
session_security();


if (!is_numeric($_POST['id'])) {
header("Location: bargraphcp.php"); }


if ($_POST['submit_edit'] = "Save") {


$num_rows = $_POST['num_rows'];
$id = $_POST['id'];
$addrows = $_POST['addrows'];
$edit_name = $_POST['edit_name'];
$edit_displayname = $_POST['edit_displayname'];

$num_rows = stripslashes($num_rows);
$id = stripslashes($id);
$addrows = stripslashes($addrows);
$edit_name = stripslashes($edit_name);
$edit_displayname = stripslashes($edit_displayname);

if($edit_displayname==null){
$edit_displayname = 0; }





// recreating arrays with easier variables and then stripping slashes that were created from magic quotes i assume
for($i=0; $i < $num_rows; $i++) {

$edit_label[$i] = $_POST['edit_label'][$i];
$edit_data[$i] = $_POST['edit_data'][$i];
$edit_delete[$i] = $_POST['edit_delete'][$i];

$edit_label[$i] = stripslashes($edit_label[$i]);
$edit_data[$i] = stripslashes($edit_data[$i]);
$edit_delete[$i] = stripslashes($edit_delete[$i]);

}


// getting db data for cross checking purposes.

include("/home/mc/secureincludes/dbconnect.inc.php");

$query = "SELECT labels, data FROM bargraph_data WHERE id ='".addslashes($id)."' ORDER BY labels ASC LIMIT 0,100";

$result = mysql_query($query);

if(!result) {
die("Query error (getting bargraph_data)". mysql_error()."<br><br>\n<a href='bargraphcp.php'>Return</a><br>\n"); }


$i = 0;

while ($row = mysql_fetch_assoc($result)) {
$data[$i] = array(
"label" => stripslashes($row['labels']),
"data" => stripslashes($row['data']));
$i++;
}
$i = null;




// getting db properties for cross checking purposes.

include("/home/mc/secureincludes/dbconnect.inc.php");

$query = "SELECT name, displayname FROM bargraph_properties WHERE id ='".addslashes($id)."' LIMIT 0,100";

$result = mysql_query($query);

if(!result) {
die("Query error (getting bargraph_data)". mysql_error()."<br><br>\n<a href='bargraphcp.php'>Return</a><br>\n"); }



$row = mysql_fetch_assoc($result);
$db_name = stripslashes($row['name']);
$db_displayname = $row['displayname'];

// checking if property name or displayname was changed and if so, updating them.

if($edit_name != $db_name or $edit_displayname != $db_displayname) {
$query = "UPDATE bargraph_properties SET name = '".addslashes($edit_name)."', displayname = '".addslashes($edit_displayname)."' WHERE id = '".addslashes($id)."' LIMIT 1";
$result = mysql_query($query);
if(!$result) {
die("There was a problem editing bargraph name or displayname setting: ".mysql_error()."<br><br>\n<a href='bargraphcp.php?id=".$id."'>Return</a><br>\n"); }

print("Bargraph name was changed from <b>'".$db_name."' </b>to <b>'".$edit_name."'</b> and displayname setting was changed from <b>'".$db_displayname."'</b> to <b>'".$edit_displayname."'</b>.<br><br>\n");
}








for($i=0; $i < $num_rows; $i++) {

if($edit_delete[$i] == 1) {


$query = "DELETE FROM bargraph_data WHERE id = '".addslashes($id)."' and labels = '".addslashes($data[$i]['label'])."' and data = '".addslashes($data[$i]['data'])."' LIMIT 1";
$result = mysql_query($query);
if(!$result) {
die("There was a problem deleting row".$data[$i]['label'].".".mysql_error()."<br><br>\n<a href='bargraphcp.php'>Return</a><br>\n"); }

print ("Entry: <b>".$data[$i]['label'].": ".$data[$i]['data']."%</b> was successfully deleted.<br>\n");

} Else {


// checking if labels and data were edited and if so updating the db with the new one
if($edit_label[$i] != $data[$i]['label'] or $edit_data[$i] != $data[$i]['data']) {

// checking data entered to make sure it is a number and it isn't below 0 or above 100.
if($edit_data[$i] <= 100 and $edit_data[$i] >= 0 and is_numeric($edit_data[$i])) {

$query = "UPDATE bargraph_data SET labels = '".addslashes($edit_label[$i])."', data = '".addslashes($edit_data[$i])."' WHERE id = '".addslashes($id)."' AND labels = '".addslashes($data[$i][label])."' AND data = '".addslashes($data[$i][data])."' LIMIT 1";
$result = mysql_query($query);
if(!$result) {
die("There was a problem editing entry: <b>".$data[$i][label]."</b>.".mysql_error()."<br><br>\n<a href='bargraphcp.php?id=".$id."'>Return</a><br>\n"); }

print("Entry: <b>".$data[$i]['label'].": ".$data[$i]['data']."%</b> has been changed to <b>".$edit_label[$i].": ".$edit_data[$i]."%</b><br>\n");

} else {


print("You entered an invalid number in percent field of label: <b>".$data[$i]['label']."</b>.<br>\n");
}
}

}

}// for loop end bracket

// checking if additional rows were specified, and if so... create them
if($addrows != 0) {

if(is_numeric($addrows) and $addrows >= 1 and $addrows <= 10) {

for($i=0;$i<$addrows;$i++) {
$query = "INSERT INTO bargraph_data ( id , labels , data ) VALUES ('".addslashes($id)."', 'UNTITLED', '0')";
$result = mysql_query($query);
if(!$result) {
die("There was a problem inserting row(s).".mysql_error()."<br><br>\n<a href='bargraphcp.php'>Return</a><br>\n"); }
}
print("Successfully added <b>".$addrows."</b> row(s).<br>\n");

} else { print("You entered an invalid number in to the addrows field. You may only add 1-10 rows at a time."); }


}
print ("<br><br>\n<a href='bargraphcp.php?id=".$id."'>Return</a><br>\n");
}

else {
header("Location: bargraphcp.php");
}

?>
 

Twista

Diamond Member
Jun 19, 2003
9,646
1
0
{QUOTE}u look good{/QUOTE}

fanx u look betta. how u doin neway.. seen u round on da forums ;
 

Mellow

Senior member
Aug 3, 2004
366
0
0
2.nc.rr.com) has joined #sunnysideup
[3:12m] * SunS^noVa`bbl is now known as SunS^noV
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |