Need to be pointed in the right direction...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jsvela
Forum Newbie
Posts: 2
Joined: Sun May 11, 2003 2:16 pm
Location: Twin Cities, MN
Contact:

Need to be pointed in the right direction...

Post by jsvela »

Hello, all!

I'm new to php and could use some assistance. I'm not sure what board this question should be on, so I'm starting here with the hope someone will tell me which board I should be on.

I have an assignment that I was told would probably be best handled with PHP and MySQL.

What I'm looking to do is this:

I have some excel webpages that are going to contain information such as: Alert Status=0, Alert Status=1, Alert Status=2

0=Green
1=Yellow
2=Red

What I need to do, however, is get a way for a webpage to call the correct image to another page depending on what the value of a cell is in the excel spreadsheet: 0, 1, or 2.

main.asp (or main.php) needs to have images called dependent upon the value of a given cell in the waittimeslink.htm page. And the waittimeslink.htm page is a page that needs to be viewable, too.
----------------------------------------------------------------------------------
If the value of cell "S10=2" (in waittimeslink.htm) then a red image needs to be displayed on main.asp (or main.php)

If the value of cell "S10=1" (in waittimeslink.htm) then a yellow image needs to be displayed on main.asp (or main.php)

If the value of cell "S10=0" (in waittimeslink.htm) then a green image needs to be displayed on main.asp (or main.php)
----------------------------------------------------------------------------------

As I mentioned before I'm new to php, but I'm not looking for the "here's how you do that! it's so easy!" response (not that I'd mind that kind of help) but I want to learn how to do it, too.

I'm sure this post belongs on another board, but I'm not sure which one, so if someone would be kind enough to point me in the right direction I'd be very appreciative.

Thanks!

Jason
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

I've popped this into the PHP forum.

Mac
jsvela
Forum Newbie
Posts: 2
Joined: Sun May 11, 2003 2:16 pm
Location: Twin Cities, MN
Contact:

Thanks!

Post by jsvela »

That was fast! Thank you for putting my post in the correct place.

Jason
Coco
Forum Contributor
Posts: 339
Joined: Sat Sep 07, 2002 5:28 am
Location: Leeds, UK
Contact:

Post by Coco »

well you can use if statements or switch statements depending on how many different cases there are (switch for more, if for less)

ie:

Code: Select all

<?php
if($status==0)
   echo '<img src=green.gif>';
if($status==1)
   echo '<img src=yellow.gif>';
if($status==2)
   echo '<img src=red.gif>';


//switch

switch($status)
{
   case(0):
   echo '<img src=green.gif>';
   break;
   case(1):
   echo '<img src=yellow.gif>';
   break;
   case(2):
   echo '<img src=red.gif>';
   break;
   //etc etc
}

?>
check out the php manual to see what it has to say about control functions

As to how to get the data from the cell..... not too sure myself, never tried to integrate excel into html :/
Post Reply