Jump to content

healthbasics

Members
  • Posts

    58
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

healthbasics's Achievements

Newbie

Newbie (1/5)

0

Reputation

  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.
×
×
  • 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.