healthbasics
Members-
Posts
58 -
Joined
-
Last visited
Everything posted by healthbasics
-
add hover over drop down menus to two of my links?
healthbasics replied to healthbasics's topic in CSS Help
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... -
How hard would this be? I found this tutorial but it reads like greek to me: http://www.seoconsultants.com/css/menus/tutorial/
-
an even more elegant solution. thanks Alex!
-
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!
-
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....
-
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.
-
Awesome! Thanks again!
-
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.
-
how to highlight links / link buttons in menu list?
healthbasics replied to healthbasics's topic in PHP Coding Help
Great success! you guys are batting 1,000 today! -
Is there a way to redirect bad requests to a 404 page?
healthbasics replied to healthbasics's topic in PHP Coding Help
works beautifully. Thanks so much!!! -
how to highlight links / link buttons in menu list?
healthbasics replied to healthbasics's topic in PHP Coding Help
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. -
Is there a way to redirect bad requests to a 404 page?
healthbasics replied to healthbasics's topic in PHP Coding Help
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*! -
Is there a way to redirect bad requests to a 404 page?
healthbasics replied to healthbasics's topic in PHP Coding Help
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? -
how to highlight links / link buttons in menu list?
healthbasics replied to healthbasics's topic in PHP Coding Help
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. -
Is there a way to redirect bad requests to a 404 page?
healthbasics replied to healthbasics's topic in PHP Coding Help
It does. Anybody know how to test? -
Is there a way to redirect bad requests to a 404 page?
healthbasics replied to healthbasics's topic in PHP Coding Help
?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. -
Is there a way to redirect bad requests to a 404 page?
healthbasics replied to healthbasics's topic in PHP Coding Help
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. -
how to highlight links / link buttons in menu list?
healthbasics replied to healthbasics's topic in PHP Coding Help
This has no discernible change in behavior that I can see -
how to highlight links / link buttons in menu list?
healthbasics replied to healthbasics's topic in PHP Coding Help
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. -
how to highlight links / link buttons in menu list?
healthbasics replied to healthbasics's topic in PHP Coding Help
Below is my style.css - would that answer your question? -
Is there a way to redirect bad requests to a 404 page?
healthbasics replied to healthbasics's topic in PHP Coding Help
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. -
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?
-
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.
-
How can I use this menu function to link to external URL's?
healthbasics replied to healthbasics's topic in PHP Coding Help
\