Jump to content

-Ricardo

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

-Ricardo's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Yes I am sorry. That was a typo. It had to be menu indeed. As I typed a few posts back, I would like to have a menu system like this: <ul> <li><a href="/index.php?id=1">Home</a></li> <!-- Is an actual link --> <li>About</li> <!-- Is an placeholder for the submenu --> <ul> <li><a href="/index.php?id=2">Who are</a></li> <!-- Submenu link --> <li><a href="/index.php?id=12">History</a></li> <!-- Submenu link --> </ul> <li><a href="/index.php?id=56">Rental</a></li> <!-- Is an actual link --> </ul> As ifMenu is 1 then its a URL and if its a 0 its a placeholder like About and there is a submenu below it. Because I have a lot of pages and I wanted to create them within a database table so I can edit them later on easy within a administration area, witch I am building later on when I am finished with this menu issue that is driving me nuts right now.
  2. That theory made sence all the way. Thank you for that TimeBomb. As for my imaganation I tried to make these tables and try to understand your theory. The following is the menu table: CREATE TABLE `pages` ( `parentId` varchar(10) DEFAULT NULL, `parentName` varchar(230) DEFAULT NULL, `isMenu` varchar(2) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB; And than I need to make the php code but I do not know where to start and how to link the table `menu` above to the table `pages` below: CREATE TABLE `pages` ( `id` int(4) unsigned NOT NULL AUTO_INCREMENT, `time` varchar(10) DEFAULT NULL, `lastby` varchar(2) DEFAULT NULL, `order_id` varchar(2) DEFAULT NULL, `text` text, PRIMARY KEY (`id`) ) ENGINE=InnoDB;
  3. Thank you for this theory and example code. How could I manage to have a table 'menu_setup' and there I control the names of the menu and if thats a URL or just a <li> to make a sub <li> and an external link instead of the pages ID? <ul> <li><a href="/index.php?id=1">Home</a></li> <!-- Is an actual link --> <li>About</li> <!-- Is an placeholder for the submenu --> <ul> <li><a href="/index.php?id=2">Who are</a></li> <!-- Submenu link --> <li><a href="/index.php?id=12">History</a></li> <!-- Submenu link --> </ul> <li><a href="/index.php?id=56">Rental</a></li> <!-- Is an actual link --> </ul> I seem not to understand how my 'theory' is simple but google does return a few results based on asp. I just want some placeholder names where I have submenus.
  4. Hello, I am making a small CMS and I having some trouble with making a dynamic menu. I am wondering for a few days how I should make this menu system. I have the follow MySQL table: CREATE TABLE `pages` ( `id` int(4) unsigned NOT NULL AUTO_INCREMENT, `time` varchar(10) DEFAULT NULL, `lastby` varchar(2) DEFAULT NULL, `order_id` varchar(2) DEFAULT NULL, `text` text, PRIMARY KEY (`id`) ) ENGINE=InnoDB; Now I would like to have a menu system as following that I make menu's in a menu table with a name and a menu ID and that I could place those pages as parent or as subparent. How could I manage to turn my theory into reality?
  5. Hello, I am currently making a small website that requires two languages. This is the class I made: <?php class languages { public function __construct() { if(!isset($_SESSION['language'])) { $_SESSION['language'] = 'nl'; } $lang = isset($_GET['lang']) ? $_GET['lang'] : ""; $languages = array('en', 'nl'); if(in_array($lang, $languages)) { $_SESSION['language'] = $lang; } } } $languages = new languages; $language = $_SESSION['language']; ?> Now as soon I use index.php?lang=en, the website will display it self in English but, as soon I remove the &lang=en from the URI, the language gets not stored in the session and it displays nl agian. Can somebody help me? Thank you!
×
×
  • 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.