Location: PHPKode > projects > Pointter PHP CMS > pointtercms_package/pointtercms_package/pointtercms/admin/functions/createcategory.php
<?php 

/***************************************************************************
 * Product Name			: Pointter PHP Content Management System
 * Version 			: V 1.2
 * Release Date			: 01/02/11
 * Copyright			: (C) 2011 PangramSoft / Murat Cevik
 * Program URL			: http://www.pointter.com
 * Company URL			: http://www.pangramsoft.com
 * Email Address                : hide@address.com
 
 ***************************************************************************/
 

/****************************************************************************

Pointter PHP Content Management System is licensed under Creative Commons Attribution Non-commercial No Derivatives 3.0 Unported (by-nc-nd) License.
To view a copy of this license, (a) visit http://creativecommons.org/licenses/by-nc-nd/3.0/ or (b) send a letter to Creative Commons, 171 2nd Street, 
Suite 300, San Francisco, California, 94105, USA.” 

You must not remove/modify/alter the copyright informations both visible and invisible forms in the source code and you must not remove/modify/alter 
the copyright informations in the footer part of the script including the Pointter image (png format file), hard link and title tag.

Please contact the copyright holder PangramSoft / Murat Cevik for a commercial license to remove the copyright information in the footer part of the script.


*****************************************************************************/

$code=$_POST[code];

//Main Category Input

if ($code==0)
 {

  $cat=$_POST[category];
  $url=str_replace(" ","",$cat); 
  $url=strtolower($url).'.php';

  if ($cat!="")
   {
   
   //Enter Category Information To Database
   include '../../configset/conn.php';
   mysql_query("INSERT INTO Category (Name,Code,Url) VALUES ('$cat','0','$url')");


   //Create PHP File For The Product
   $code=file_get_contents('tempcat.php');
   $file="../../".$url;
   $temp=fopen($file,"w");
   fwrite($temp,$code);
   fclose($temp);

   //Enter Category View Information To Database
   mysql_query("INSERT INTO Views (Url,Name,Type) VALUES ('$url','$cat','Category')");

   //Enter Category Metatag Information To Database
   mysql_query("INSERT INTO Metatags (Url) VALUES ('$url')");

   mysql_close($connect);
   }

 }



//Sub Category Input

if ($code==1)
 {
 
  $main=$_POST[main];
  $subcat=$_POST[subcategory];
  $suburl=str_replace(" ","",$subcat); 
  $suburl=strtolower($suburl).'.php';


  if ($subcat!="")
   {
   
   //Enter Category Information To Database
   include '../../configset/conn.php';
   mysql_query("INSERT INTO Category (Name,Code,Url,Subcode) VALUES ('$subcat','1','$suburl','$main')");


   //Create PHP File For The Product
   $code=file_get_contents('tempcat.php');
   $file="../../".$suburl;
   $temp=fopen($file,"w");
   fwrite($temp,$code);
   fclose($temp);

   //Enter Category View Information To Database
   mysql_query("INSERT INTO Views (Url,Name,Type) VALUES ('$suburl','$subcat','Category')");

   //Enter Category Metatag Information To Database
   mysql_query("INSERT INTO Metatags (Url) VALUES ('$suburl')");

   mysql_close($connect);

   }

 }


header ("location:../category.php");

?>
Return current item: Pointter PHP CMS