hashish Posted December 11, 2006 Share Posted December 11, 2006 What's up guys. My first post here, and I'm not great with php, but here's my question:My current navigation works using the get function, so my links are like "index.php?x=page".I have about 200 pages, so FTP is getting cluttered. Now what I want to do is make a directory for all the categories of content, and be able to link to the files like ?x=applications&cat=downloads. Assuming I have a directory called downloads and a file named applications.php.I've seen this code somewhere before. Is this a simple form of breadcrumb? Or can someone lead me in the right direction here? I don't want to have to use a huge breadcrumb script, just something simple is all I need.Thanks. Link to comment https://forums.phpfreaks.com/topic/30187-resolved-php-navigation/ Share on other sites More sharing options...
trq Posted December 11, 2006 Share Posted December 11, 2006 [code]<?php if (isset($_GET['x'] && isset($_GET['cat'])) { if (file_exists($_GET['cat'].'/'.$_GET['x'].'.php')) { include $_GET['cat'].'/'.$_GET['x'].'.php'; } }?>[/code] Link to comment https://forums.phpfreaks.com/topic/30187-resolved-php-navigation/#findComment-138792 Share on other sites More sharing options...
hashish Posted December 11, 2006 Author Share Posted December 11, 2006 Sounds like what I need. I'm getting:Parse error: syntax error, unexpected T_BOOLEAN_AND, expecting ',' or ')' in index.php on line 138Could someone clean that code up for me please? It's be great to also add in:if x and cat = nothing. then include news.php. Link to comment https://forums.phpfreaks.com/topic/30187-resolved-php-navigation/#findComment-138804 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.