Mouse Posted September 5, 2006 Share Posted September 5, 2006 Ok, I am a total lose where to start with this… maybe I am being a little too cleaver for my own good, or perhaps I am just too dumb today to work this out for myself…What I have is two lists:One is a list of quotes, and their speakers,The other is a list of “on this day” and the relevant years.What I am aiming to do is…Ifthere is a listing for today in this list then put “what happened” in box “a” and ‘On this day’ and the year in box “b”elseput random quote in box “a” and site the speakers name in box “b”at the moment I am part way there on my homepage with the quote part (see http://mouse.nodstrum.com/index.php) but I just cant get my head around how to get the if’s and else’s to make this work….HELP(pretty please)Mouse Quote Link to comment Share on other sites More sharing options...
AndyB Posted September 5, 2006 Share Posted September 5, 2006 List? Like an array, like something in a database or textfile? Maybe we need to see what you have already as code and that'll help make this easier to understand (from the viewpoint of what help, pretty or otherwise, you need) Quote Link to comment Share on other sites More sharing options...
Mouse Posted September 5, 2006 Author Share Posted September 5, 2006 to be honest, what ever works best... all the quotes are in a txt file and i'm just writing the on this day file but using Excel for ease of keeping it all together... so i am open...Quote:[code]<?php// Array Structure: "Quote","Author"$allqts = array ("You can create the most wonderful place in the world. But it takes people to make the dream a reality. - Walt Disney","You may not realize it when it happens, but a kick in the teeth may be the best thing in the world for you. - Walt Disney","It's not hard to make decisions when you know what your values are. - Roy Disney","There's no good idea that can't be improved on. - Michael Eisner","Succeeding is not really a life experience that does that much good. Failing is much more enlightening. - Michael Eisner","Well, when you're trying to create things that are new, you have to be prepared to be on the edge of risk. - Michael Eisner" );$totalqts = (count($allqts)/2);$nmbr = (rand(0,($totalqts-1)));$nmbr = $nmbr*2;$quote = $allqts[$nmbr]; $nmbr = $nmbr+1;echo "<Font color=$textcolor>";echo "$quote<br>";echo "</font>";IF ($PHP_SELF == "/quotes.php") { show_source("quotes.php"); }?>[/code](and thanks for the interest...)Mouse Quote Link to comment Share on other sites More sharing options...
Mouse Posted September 5, 2006 Author Share Posted September 5, 2006 i think i should also point out that while the site is mone, i tend to do mostly the design side and let my coding partner do the back end bits... but pride is getting to me and i need to do some of the coding myself...Mouse Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.