Jump to content


This topic is now archived and is closed to further replies.


if date then do this if not go do that.... ????? Grrrrrr!!!!

Recommended Posts

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…

there 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”
put 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….


(pretty please)


Share this post

Link to post
Share on other sites
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)

Share this post

Link to post
Share on other sites
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...

// 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") {


(and thanks for the interest...)


Share this post

Link to post
Share on other sites
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...


Share this post

Link to post
Share on other sites


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.