tuckerm Posted June 15, 2007 Share Posted June 15, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/55669-solved-php-script/ Share on other sites More sharing options...
rtpmatt Posted June 15, 2007 Share Posted June 15, 2007 can you post what you are modifying so we can see what you are working with? Quote Link to comment https://forums.phpfreaks.com/topic/55669-solved-php-script/#findComment-275078 Share on other sites More sharing options...
tuckerm Posted June 15, 2007 Author Share Posted June 15, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/55669-solved-php-script/#findComment-275080 Share on other sites More sharing options...
rtpmatt Posted June 15, 2007 Share Posted June 15, 2007 well i can see you arent closing your parentheses on your if statement Quote Link to comment https://forums.phpfreaks.com/topic/55669-solved-php-script/#findComment-275082 Share on other sites More sharing options...
tuckerm Posted June 15, 2007 Author Share Posted June 15, 2007 Ah yes, That did it. Thanks matt Quote Link to comment https://forums.phpfreaks.com/topic/55669-solved-php-script/#findComment-275089 Share on other sites More sharing options...
rtpmatt Posted June 15, 2007 Share Posted June 15, 2007 Glad i could help, i like it when they are easy to fix! Quote Link to comment https://forums.phpfreaks.com/topic/55669-solved-php-script/#findComment-275090 Share on other sites More sharing options...
tuckerm Posted June 15, 2007 Author Share Posted June 15, 2007 One more quick question: I want to insert this as a file, eg: I want the browser to pull the data from timer.php so if I have to update a special I don't have to update each page, just timer.php. How can I achive this in HTML? Quote Link to comment https://forums.phpfreaks.com/topic/55669-solved-php-script/#findComment-275093 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.