| [ Index ] |
PHP Cross Reference of Drupal 6 (heimberg) |
[Summary view] [Print] [Text view]
1 <?php 2 if($_REQUEST[name] != null){ 3 $sql = "UPDATE CATEGORY SET name = '" . $_REQUEST[name] . "', parentCatId = "; 4 5 if($_REQUEST[parentCategoryList] ==""){ 6 $sql = $sql . "null"; 7 } else { 8 $sql = $sql . "'" . $_REQUEST[parentCategoryList] . "'"; 9 } 10 if($_REQUEST[state] !=""){ 11 $sql = $sql . ", state = '" . $_REQUEST[state] . "'"; 12 } 13 $sql = $sql . " where id = " . $_REQUEST[id]; 14 require_once ('DbLib-12.php'); 15 $db = &new DbLibMySQL; 16 $db->OpenConnection(); 17 $db->Query($sql); 18 if($_REQUEST[parentCategoryList] != null) { 19 $sql = "select name from category where id = $_REQUEST[parentCategoryList]"; 20 $db->Query($sql); 21 $db->GetNextRecord(); 22 $catName = $db->GetField('name'); 23 } else { 24 $catName = ""; 25 } 26 $sql = "SELECT id FROM Category where name = '$_REQUEST[name]'"; 27 $db->Query($sql); 28 $db->GetNextRecord(); 29 $id = $db->GetField('id'); 30 $db->CloseConnection(); 31 32 $msg = "Successfully updated category"; 33 } else { 34 //redirect 35 header( 'Location: update.php' ) ; 36 } 37 ?> 38 39 <html> 40 41 <head> 42 <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> 43 <meta name="generator" content="Adobe GoLive 5"> 44 <title>Update Category</title> 45 </head> 46 47 <body bgcolor="#ffffff"> 48 <p><?php echo $msg ?></p> 49 50 <br>Name: <?php echo $_REQUEST[name] ?> 51 <br>Parent Category: <?php echo $catName; ?> 52 53 <p></p> 54 <p><a href="updateCategoryForm.php?categoryList=<?php echo $id;?>">Modify Category</a></p> 55 56 </body> 57 </html>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Wed Mar 23 13:22:29 2011 | Cross-referenced by PHPXref 0.7 |