Jump to content

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


Mouse

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…

If
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”
else
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….

HELP

(pretty please)

Mouse
Link to comment
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...

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
Link to comment
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...

Mouse
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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