Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> PHP
Author Message
Donovan
Client



Joined: Oct 07, 2003
Posts: 735
Location: Ohio

PostPosted: Wed Jan 10, 2007 9:26 am Reply with quote

If I wanted people to have access to a script only from Monday till Wednesday how could I do it? Any example would be great.
 
View user's profile Send private message Visit poster's website ICQ Number
Donovan







PostPosted: Wed Jan 10, 2007 9:43 am Reply with quote

Would something like this work? Somebody please check my syntax.

Code:
function checkmovedate(){

include_once("header.php");
global $db, $prefix;

$curdayofweek = date("l",mktime());
//Monday = 1, Tuesday = 2, Wednesday = 3 .. etc

if (($curdayofweek < 1) && ($curdayofweek > 3)) {
Opentable();
echo "Moves are only allowed from Monday till Wednesday";
Closetable();
}
include('footer.php');
}
 
Gremmie
Former Moderator in Good Standing



Joined: Apr 06, 2006
Posts: 2415
Location: Iowa, USA

PostPosted: Wed Jan 10, 2007 11:28 am Reply with quote

Change to

$curdayofweek = date('w'); // returns 0-6 with 0 == Sunday

and

if ($curdayofweek < 1 || $curdayofweek > 3)
 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> PHP

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©