Jump to content

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

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.