Jump to content

healthbasics

Members
  • Posts

    58
  • Joined

  • Last visited

Everything posted by healthbasics

  1. I just have two places on my page where I want a drop down of a two sub options on mouseover but I don't know anything about css. I was thinking that maybe my situation is much less complex than the tutorial and I could do it with just a couple of lines or maybe it could be done with php some how...
  2. How hard would this be? I found this tutorial but it reads like greek to me: http://www.seoconsultants.com/css/menus/tutorial/
  3. an even more elegant solution. thanks Alex!
  4. Not quite but following your logic I got it. what i needed was <?php echo "/img/" . $pic[rand(0,1)]; ?> <?php echo "/img/" . $pic[rand(0,2)]; ?> gave me each picture sometimes and once in a while a blank. I figure 0,2 must be an array of 3 with values of 0, 1, 2... Thanks!
  5. halfway there. This time it appears to work half the time. Half the time it returns: <div id="main-image"><img src="/img/" height="240px" width="240px" alt="" /></div> and the other half <div id="main-image"><img src="/img/shot2.jpg" height="240px" width="240px" alt="" /></div> It seems like whenever it selects shot1.jpg from the random function it returns nothing....
  6. I guess I screwed something up. Can I call it like this or no? Do i have to cram that whole statement together as one into the spot where I want the image or did I just put a quote in the wrong place or something? <?php $pic = array( "shot1.jpg", "shot2.jpg", ); ?> </div> <div id="right-column"> <div id="main-image"><img src="<?php echo "/img/'.$pic[rand(1,2)].'" ?>" height="240px" width="240px" alt="" /></div> <div class="sidebar"> <ul id="menu"> My pics are stored in a subdir called img/ from the root. mydomain.com/img/ for example. Thanks.
  7. Could I code something in php that would take a static image on my website and randomly rotate (whenever someone loads the page) among 3 or 4 or 5 different selections of image all of the same format, size, dimension, etc? If so how could I do that. Thanks.
  8. Great, thanks for your help. Now that the formating of the site is back to normal it's not so urgent but I would like to fix it if I can.
  9. My index.php is: <?php include "menu.inc.php"; function menu($_menu){ $str = ''; foreach($_menu as $url => $name){ $sel = ($_GET['page'] == $url ) ? ' id="selected" ' : ''; $str .= "<li ". $sel ."><a class='five' href=" . $url . " >" . $name . "</a></li>"; } echo $str; } $page = ( isset($_GET['pg']) ? $_GET['pg'] : ((isset($_GET['page']))? $_GET['page']:'home')); $file = basename($page).'.php'; $html_path = "php/"; if (file_exists($html_path.$file)) include $html_path.$file; ?> ANd my first guess was wildly wrong - doing that creates a nice blank white page for *everything*!
  10. This sounds good but where to put it? if (condition == failure) { header(); } else { display } Taking a stab... can I just do: if (file_exists($html_path.$file)) { include $html_path.$file; } else { include $html_path.404; } (Note: I created a file 404.php for this exercise) Where do I place this code? Just in index.php?
  11. Again I'm not seeing any difference in the way the site behaves when I use that line instead of the one that was there. I am also not finding the term 'selected' anywhere in the source.
  12. ?page=[good name] loads .\php\[good name].php I am not real picky about the exact mechanics of how to do this or what is displayed so long as it's SOMETHING. I just felt like it should be something more than a totally blank white page incase somebody links in with a malformed link. Automatic redirection to the root home page would be fine. Redirection to my 404 page would be fine too, really anything besides just a plain blank page. If this is a huge deal or requires my sql implementation to do it I'll definitely put this on the back burner but I thought there might be a quick fix.
  13. I don't have my sql and there is no implementation for checking or anything in place. That's what I'm trying to do now. I was trying to prevent people that send a bad request (for example if the site changes and there are latent search engine links) from simply getting a completely blank white page. Is there an easy way to do this? @DevilsAdvocate - I read that but it doesn't really make clear to me what I have to put where to accomplish what I'm trying to do.
  14. This has no discernible change in behavior that I can see
  15. The mouseover highlight already works just fine (and always did). The highlight for the current page used to work until I made some changes given here today to allow easier linking to external sites on the menu. I am trying to get it back to the point where the button for the page you are currently viewing would be highlighted. ANy idea how to do that? I tried swaping the line of code you recommended but it resulted in the page not loading at all. It would just be completley blank when I visited the home page.
  16. Below is my style.css - would that answer your question?
  17. I read that and I see that you can use this function for this but where exactly would put what exact code to redirect to .\php\not_found.php for example? I am not really all that experienced with this, sorry.
  18. http://mysite.com/[garbage] http://mysite.com/[garbage].html http://mysite.com/[garbage]/[garbage] All redirect to my 404 page no problem. I did this with an .htaccess redirect. However, requests like http://mysite.com/index.php?page=[garbage] produces a completely blank page. Is there anyway i can redirect to something when the page doesn't exist?
  19. My website used to highlight the current link in a dark color (similar to the mouseover or maybe even the same) but when I made some updates to allow external links more easily and to correct a problem with global variables someone here recommended I change the highlighting stopped working. Anyone know how I can turn it back on? Menu list code: <? $_menu = array('index.php?page=home' => 'Philosophy & Focus', 'index.php?page=biography' => 'Biography', 'index.php?page=consultations' => 'Consultations', 'index.php?page=classes' => 'Classes', 'index.php?page=client_comments' => 'Client Comments', 'index.php?page=calendar' => 'Calendar', 'http://shop.healthbasics.net/collections/health-basics' => 'Products', 'http://www.healthbasics.net/blog/' => 'Blog', 'index.php?page=recommended_reading' => 'Recommended Reading', 'index.php?page=recommended_viewing' => 'Recommended Viewing', 'index.php?page=links_resources' => 'Links & Resources', ); And here is how it gets called from index.php: include "menu.inc.php"; function menu($_menu){ $str = ''; foreach($_menu as $url => $name){ $sel = ($_GET['page'] == $url ) ? ' id="selected" ' : ''; $str .= "<li ". $sel ."><a href=" . $url . " >" . $name . "</a>\n"; } echo $str; } Thanks.
×
×
  • 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.