Posted by lol Tue 27th Feb 2007 21:06 - Syntax is PHP - 34 viewsRun this post in the PHP shell
Download | New Post | Modify | Hide line numbers
PHP parser reported no syntax errors in this post!
Description:
asdasd

  1.     $categories = array("category.category_id = 379", "(category.category_id = 148 OR category.category_id = 50)", "(category.category_id = 9 OR category.category_id = 471)", "(category.category_id = 379 OR category.category_id = 380 OR category.category_id = 7 OR category.category_id = 450 OR category.category_id = 370 OR category.category_id = 447)", "category.category_id = 394");
  2.  
  3.     $x=1;
  4.     foreach ($categories as $category_sql) {
  5.  
  6.       $data = mysql_query("SELECT * FROM product, category WHERE product.placement_pp=1 AND ".$category_sql." AND product.category_key=category.category_id AND (active=1 OR active=2) AND category.name IS NOT NULL ORDER BY category.name ASC");
  7.       unset($id, $names, $globKey, $catKey);
  8.       while($row = mysql_fetch_array($data)) {
  9.           $id = $row['category_id'];
  10.           $names[$id] = $row['name'];
  11.       }
  12.       $new = array_unique($names);
  13.  
  14.       # jesus christ I dont want perfumes here!
  15.       unset($new[6],$new[2],$new[1]);
  16.       print "var menu".$x."=new Array()\n";
  17.       $i = 0;
  18.       if ($x == 1) $catname = "SkinCare";
  19.       elseif ($x == 2) $catname = "HairCare";
  20.       elseif ($x == 3) $catname = "BodyBath";
  21.       elseif ($x == 4) $catname = "Candles";
  22.       elseif ($x == 5) $catname = "GiftSets";
  23.       foreach($new as $catKey => $catName) {
  24.             $globKey[] = $catKey;
  25.             print "menu".$x."[$i]='\"http://www.perfunique.com/".$catname."/$catKey.html\" class=\"leftmenu\">$catName';\n";
  26.             $i++;
  27.       }
  28.       $x++;
  29.     }
  30. ?>
  31.  
  32.  
  33. WORK GREAT UNTILL GETS TO X = 5 !
  34.     var menu1=new Array()
  35. menu1[0]='';
  36. var menu2=new Array()
  37. menu2[0]='';
  38. menu2[1]='';
  39. var menu3=new Array()
  40. menu3[0]='';
  41. menu3[1]='';
  42. var menu4=new Array()
  43. menu4[0]='';
  44. menu4[1]='';
  45. menu4[2]='';
  46. menu4[3]='';
  47. menu4[4]='';
  48. menu4[5]='';

  49. Warningarray_unique(): The argument should be an array in /usr/local/psa/home/vhosts/perfunique.com/httpdocs/header.php on line 61
  50. var menu5=new Array()

  51. Warning:  Invalid argument supplied for foreach() in /usr/local/psa/home/vhosts/perfunique.com/httpdocs/header.php on line 72
  52.  
  53. wots the prob ?

PermaLink to this entry https://pastebin.co.uk/11091
Posted by lol Tue 27th Feb 2007 21:06 - Syntax is PHP - 34 viewsRun this post in the PHP shell
Download | New Post | Modify | Hide line numbers

 

Comments: 0