Jump to content

wait

Members
  • Posts

    14
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

wait's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Makes a bit more sense doing it your way. Time for some more coffee. Thanks.
  2. Well, I'm open for suggestions. I have a directory called /u/ and would like the username or profile page not to have a .php extension. I would like to handle this in the most efficient way. Just don't know how to go about it. I read this can be handled in .htaccess but if there is a better way.... I'm open. - Stupid question (avatar) Got it.
  3. Great! Thanks. That is what I was looking for. Now if only I could update my avatar. This feature seems to be disabled on my profile. Any thoughts?
  4. I've searched google for this and I'm not 100% sure if this is even a .php related request but... I'm attempting to create (for lack of better description) "false directories" that prevent the .php extention from displaying in specific URLs. I'm creating user profiles for my site and rather than display: .com/u/username.php I would like to display: .com/u/username I have a feeling this might be server related. Shot in the dark. Hope someone can shead some light on this for me. Thanks as always!
  5. Forgive my ignorance but I was hoping for a code example. Could I do a simple if, else... statement? If ID of Page = X then display DIV containing ID equaling X.
  6. I'm sure this is fairly simple... Let’s say I have hundreds of pages, each require a short description per page. I also have one individual file with every short description on it. All the descriptions within this one file are each separated by DIVs that carry a unique ID. I would like to reference that unique ID on the “hundreds of pages” rather than copy and paste content on each page. So, one includes file is referenced per page calling the unique ID a specific DIV. Thanks in advance!
  7. Exactly what I was looking for! Thank you for spending the time to help.
  8. It is php in my header file. <? $dots = function($url=null){ $tmp = dirname($_SERVER["PHP_SELF"]); $tmp = str_replace('\\', '/', $tmp); $tmp = explode('/', $tmp); $relpath = null; for ($i = 0; $i < count($tmp); $i++){ if ($tmp[$i] != '' && $i >= 2) $relpath .= '../'; } $relpath = ($relpath != null) ? substr($relpath, 0, -1) : '.'; if ($url){ if (substr($url, 0, 1) != '/') return $relpath .= ('/' . $url); return $relpath .= $url; } else return $relpath; }; ?>
  9. That fixes my issue with nested directories. The left nav is on every page so $dots function creates relative links based on where you are within the site. I didn't want to build my left-nav with absolute links.
  10. Thank you... Works great! Finally, how do I apply individual links and exclude the first "li" for a title? Example: <ul> <li><h3>Car</h3></li> <li><a href="<?= $dots('cars/model/car-1.php'); ?>">Car 1</a></li> <li><a href="<?= $dots('cars/model/car-2.php'); ?>">Car 2</a></li> <li><a href="<?= $dots('cars/model/car-3.php'); ?>">Car 3</a></li> </ul> Thank you again for all the help!
  11. Here is a better example of what I have done so far. Hope this helps. I was able to get only the "cars" section to display but I receive an error (Notice: Undefined variable: trucks in C:\server\www\BA\inc\left-nav.php on line 32 ) for trucks and motorcycles on the cars page. Code on the included menu: <div id="left-nav"> <!-- Cars --> <?php if ($cars == true): ?> <ul> <li><a href="#">Car</a></li> <li><a href="#">Car 1</a></li> <li><a href="#">Car 2</a></li> <li><a href="#">Car 3</a></li> </ul> <?php endif; ?> <!-- Trucks --> <?php if ($trucks == true): ?> <ul> <li><a href="#">Truck</a></li> <li><a href="#">Truck 1</a></li> <li><a href="#">Truck 2</a></li> <li><a href="#">Truck 3</a></li> </ul> <?php endif; ?> <!-- Motorcycles --> <?php if ($motorcycle == true): ?> <ul> <li><a href="#">Motorcycle</a></li> <li><a href="#">Motorcycle 1</a></li> <li><a href="#">Motorcycle 2</a></li> <li><a href="#">Motorcycle 3</a></li> </ul> <?php endif; ?> </div> Code on the corresponding page: <? $cars = true; include('../inc/left-nav.php'); ?>
  12. I'm relatively new to php so please forgive any noobish questions that I may have.. I've created a left menu (within an inc) that is simply a series of styled unordered lists. I would only like to display the portion of the menu relative to what page the user is on. So for example: if the user is looking at cars and the menu covers cars, trucks, and motorcycles; I would only like the cars section to be presented. <div id="left-nav"> <!-- Cars --> <ul> <li><a href="#">Car</a></li> <li><a href="#">Car 1</a></li> <li><a href="#">Car 2</a></li> <li><a href="#">Car 3</a></li> </ul> <!-- Trucks --> <ul> <li><a href="#">Truck</a></li> <li><a href="#">Truck 1</a></li> <li><a href="#">Truck 2</a></li> <li><a href="#">Truck 3</a></li> </ul> <!-- Motorcycles --> <ul> <li><a href="#">Motorcycle</a></li> <li><a href="#">Motorcycle 1</a></li> <li><a href="#">Motorcycle 2</a></li> <li><a href="#">Motorcycle 3</a></li> </ul> </div> I assume this can be handled by a simple id but, unfortunately I don't know the code implantation to make it functional. Thank you much in advance!
×
×
  • 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.