(file) Return to func_editcat.php CVS log (file) (dir) Up to [RizwankCVS] / geekymedia_web / mysqlinks / lib

 1 rizwank 1.1 <?php
 2             //get set
 3             include('./config.php');
 4             
 5             // get authorised
 6             include('./validate.php');
 7             
 8             // get connected
 9             include('./database.php');
10             
11             ?>
12             <?php
13             
14             if ($HTTP_POST_VARS['type'] == "rename") {
15                   // check that they're not trying to rename to the same as an existing category
16                   $results = mysql_list_tables($mysqdb['name']) or die("Invalid request: " . mysql_error());
17                   
18                   while ($row = mysql_fetch_row($results)) {
19                   	$cats[] = $row[0]; 	
20                   }
21                   		
22 rizwank 1.1       mysql_free_result($results);
23                   
24                   if(in_array($HTTP_POST_VARS['edit_category_name'],$cats)) {
25                   		$go = "Location: " . $mysqvars[url] . "/admin.php?func=2&stage=2&edit_category=" . $HTTP_POST_VARS['orig_category_name'] . "&msg=95"; 
26                   		header($go);
27                   } else {
28                   		$query = "ALTER TABLE `$HTTP_POST_VARS[orig_category_name]` RENAME `$HTTP_POST_VARS[edit_category_name]`";
29                   		 $results = mysql_query($query) or die("Invalid request: " . mysql_error());
30                   		 $go = "Location: " . $mysqvars[url] . "/admin.php?func=2&msg=94&stage=2&edit_category=" . $HTTP_POST_VARS['edit_category_name']; 
31                   		header($go);
32                   }
33             } elseif ($HTTP_POST_VARS['type'] == "redesc") {
34                   		$query = "ALTER TABLE `$HTTP_POST_VARS[orig_category_name]` COMMENT = '$HTTP_POST_VARS[edit_category_desc]'";
35                   		 $results = mysql_query($query) or die("Invalid request: " . mysql_error());
36                   		 $go = "Location: " . $mysqvars[url] . "/admin.php?func=2&stage=2&edit_category=" . $HTTP_POST_VARS['orig_category_name'] . "&msg=93"; 
37                   		header($go);
38             }			 
39             
40             ?>

Rizwan Kassim
Powered by
ViewCVS 0.9.2