Jump to content

irkevin

Members
  • Posts

    295
  • Joined

  • Last visited

Everything posted by irkevin

  1. Hi phpfreaks community, My name is ian and I would like to offer my services as a PHP developer. I have 9+ years of experience in PHP/MySQL, basically the WEB in itself + a strong knowledge in Symfony framework and other related framework. I work with HTML, CSS, JavaScript, jQuery, node.js, angular.js, MySQL, PHP, Symfony, CodeIgniter. Feel free to send me an email for more information: [email protected] Have a good day/evening Regards, Ian
  2. You mean you let the user alter you database tables? Maybe and INSERT INSERT INTO tableName(your_fields) VALUES(your_values)
  3. Hi, I have a function that display an infinite list of categories.. So far this work fine.. But now I want to display only the second level of every main category and not the subs.. Consider this: Main1 Main2 Main3 Main4 car1 Bike1 watch1 Game1 SubSub1 SubSub1 SubSub1 SubSub1 car2 Bike2 watch2 Game1 SubSub2 SubSub2 SubSub2 SubSub2 What I want to achieve is, display on Car1 Car2 Bike1 Bike2 Watch1 Watch2 Game1 Game2 Here is the code I have so far: function get_cat() { db_connect(); $sql = "SELECT * FROM category"; $result = mysql_query($sql); if(mysql_num_rows($result) > 0){ while($row = mysql_fetch_array($result)){ $menu_array[$row['id']] = array( 'name' => $row['name'], 'parent' => $row['parent_id'], 'id' => $row['id'] ); } return $menu_array; } } function generatemenu($parent,$array){ $has_childs = false; //this prevents printing 'ul' if we don't have subcategories for this category //use global array variable instead of a local variable to lower stack memory requierment foreach($array as $key => $value) { if ($value['parent'] == $parent){ $has_childs = true; if($has_childs == true){ if($value['parent'] == 0) echo '<ul class="main">'; else echo '<ul class="subs">'; } //if this is the first child print '<ul>' if($value['parent'] == 0) echo '<li><a href="index.php?category='.$value['id'].'">' . $value['name'] . '</a>'; else echo '<li><a href="index.php?category='.$value['id'].'">' . $value['name'] . '</a>'; generatemenu($key ,$array); //call function again to generate nested list for subcategories belonging to this category echo '</li>'; if($has_childs == true) echo '</ul>'; } } } Can someone help?
  4. I need to set a cookie, and later update it. Meaning, the cookie needs to retain its current value, plus add new values to it from GET variable data. Nobody to help?
  5. Hi here is my problem, i have a link like : index.php?id=1 When user click on it, a cookie array is set with a value of 1 when user clicks on another link with an id of 2, the same cookie is set with another value of 2, at the end , the cookie should read: array( [0] => 1 [1] => 2) Can someone please explain how to do this? im struggling :S
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.