Jump to content

[SOLVED] PHP Script


tuckerm

Recommended Posts

I'm looking to use a script to display a restraunt's daily specials. I'm modifying a script but it doesn't work and I havent got a clue on where to start. Can anyone kindly help me? I'm looking to do a 7 day a week script that echos the servers current time (only the day) so if the special on Saturday is Pork Prime Rib for $12.95 it will display it.

 

Thanks,

Tucker

Link to comment
https://forums.phpfreaks.com/topic/55669-solved-php-script/
Share on other sites

Neglected to do that in my orignal post.

 

My current script I use for my talkshow. It shows an image when the show is on (on air) and shows when it's off air other wise. Now i'm assuming that I can just take the hour out because the server time is offset by one hour which won't matter at all. When i tried putting text instead of imgurl I got an error. Here's the unedited version:

<?php
if (date('w') == 5 or 6 && date('G') >= 23 && date('G') <= 01)
{  $imgurl = "http://www.themsrliveshow.com/images/on_air.gif";
}
else
{  $imgurl = "http://www.themsrliveshow.com/images/off_air.bmp";
}
echo "<img src=\"$imgurl\">";
?> 

 

My Version:

<?php
if (date('w') == 1
{  $text = "Lunch: 2 PC. Fish Dinner $6.95<BR> Dinner: All-U-Can Eat Fish Fry $9.95";
}
if (date('w') == 2
{  $text = "Lunch: 2 PC. Fish Dinner $6.95<BR> Dinner: All-U-Can Eat Fish Fry $9.95";
}
if (date('w') == 3
{  $text = "Lunch: 2 PC. Fish Dinner $6.95<BR> Dinner: All-U-Can Eat Fish Fry $9.95";
}
if (date('w') == 4
{  $text = "Lunch: 2 PC. Fish Dinner $6.95<BR> Dinner: All-U-Can Eat Fish Fry $9.95";
}
if (date('w') == 5
{  $text = "Lunch: 2 PC. Fish Dinner $6.95<BR> Dinner: All-U-Can Eat Fish Fry $9.95";
}
if (date('w') == 6
{  $text = "Lunch: 2 PC. Fish Dinner $6.95<BR> Dinner: All-U-Can Eat Fish Fry $9.95";
}
if (date('w') == 7
{  $text = "Lunch: 2 PC. Fish Dinner $6.95<BR> Dinner: All-U-Can Eat Fish Fry $9.95";
}
echo "$text";
?> 

 

Later on I'll edit each specific day to what the menu says, but right now i'm just getting a parse error. I'm not very familur with PHP but I understand the basics.

Link to comment
https://forums.phpfreaks.com/topic/55669-solved-php-script/#findComment-275080
Share on other sites

Archived

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

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