Jump to content

Recommended Posts

Hi guys, if this is only for pros then you're gonna kick me out of here.  :-[  I just came from a CSS site asking them this question and was informed that this was PHP..so that's how dumb I am.  :-\

I design websites, flash websites and some Dreamweaver and Wordpress stuff.  someone asked me to do some basic updates on their website, and the site is done in CSS...and PHP...  For the moment, the main question is this:

There is a document which is called "rotating.specials", in there, the script tells it to show a different special each day.  She wanted this removed.  The date is part of this script.  She wants the date to stay.  So!  Here is the current script:

<?php

 

$today= date("l");

//echo $today;

 

 

switch ($today) {

 

  case "Monday" :

  echo $today . "'s Special" . '<font color="#FF9933"> 25% off </font>

    Services<br> Senior Citizens & College Students';

  break;

 

  case "Tuesday" :

  echo $today . "'s Special" .'<font color="#FF9933"> 20% off </font>

  Services<br>  Restraunt & Grocery Employees';

  break;

 

  case "Wednesday" :

  echo $today . "'s Special" .'<font color="FF9933"> 20% off </font>

  Services <br>Police & Fire Dept. Employees';

  break;

 

  case "Thursday" :

  echo $today . "'s Special" .'<font color="FF9933"> 20% off </font>

  Services<br>Hospital & Medical Employees';

  break;

 

  case "Friday" :

  echo $today . "'s Special" .'<font color="FF9933"> 20% off </font>

  Services<br> City & County Employees';

  break;

 

  default :

  echo 'Militay Special <font color="#FF9933">25% off</font>

  Services<br> every Monday - Friday!    ';

  break;

 

  }

 

 

?>

 

Can you please tell me how to modify this to only show the current date?  I appreciate your help very much!  Thanks!

Link to comment
https://forums.phpfreaks.com/topic/142312-h-e-l-p-pleez/
Share on other sites

The function date("l") shows the current day. Do you mean the day? or date? If its date, check out the php manual it has the different formats that you can display it. When you change the date function you are going to have to edit each case to match the new defined date function.

 

http://www.php.net/manual/en/function.date.php

Link to comment
https://forums.phpfreaks.com/topic/142312-h-e-l-p-pleez/#findComment-745687
Share on other sites

  Quote

Thank you guys SO much!  I'll look at this and try it out and let you know how it goes! 

 

 

Please keep your copying paste out of the forums.

 

ppl here are here to help people who appreciate php and don't just copy and paste.

 

You don't even know the technologies your site is built in (Fyi CSS isn't even a technology its css first off and its a styling language not a functional or markup  language like xHTML JavaScript PHP or ASP)

 

You are the kind of people that give legit web designers a bad rep

Link to comment
https://forums.phpfreaks.com/topic/142312-h-e-l-p-pleez/#findComment-746313
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.