473,399 Members | 2,146 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

how to block the entry of a user to log in on a particular day

we r doing the project INVENTORY MGMT SYSTEM. it is just like a super bazar producung bills in computer using PHP with database POSTGRESQL.
ny question is.....................
the shop is holiday on every sunday. so, on every sunday, if some one in the store try to login, they should not be allowed to enter. how to acheive this ? is there any concept to complete this task?
plzzzzzzz help me in this regard. urgent!!!!!!!!!!!!!!!
thanks in advance
Mar 24 '07 #1
1 1076
michaelb
534 Expert 512MB
You can have something like this PHP code in the file that handles logins:
Expand|Select|Wrap|Line Numbers
  1. if (date('l') ===  'Sunday')
  2.    // deny login; redirect to other page
  3.    // or display some message and quit 
  4. else 
  5.    // proceed with normal login;
  6.    // verify login/password etc
  7.  
In real life you probably won't want to hardcode Sunday here, the following approach seems cleaner to me:

Expand|Select|Wrap|Line Numbers
  1. if ( SiteIsUp() )
  2.    // proceed with normal login;
  3.    // verify login/password etc
  4. else 
  5.    // deny login; redirect to other page
  6.    // or display some message and quit 
  7.  
SiteIsUp (not the best name, perhaps) is a function where you identify all required criteria.
In addition to day of the week this function may have to check on other factors -
when you do a site maintenance, software upgrade, etc you may just set some variable and this function will deny access to the site.
Mar 24 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: deko | last post by:
Problem: why doesn't this With block work? is it possible to have a For Each loop within a With block? With objWord .Documents.Add Template:=strTemplate, NewTemplate:=False, DocumentType:=0...
16
by: Bill | last post by:
Say I have a childThread currently is running a finally block to cleanup external resources. At the same time the main thread calls childThread.Abort(). The question is: when the...
3
by: Charles Law | last post by:
Under what circumstances would e.Cancel be set to True on entry to the Closing event of an MDI child form? I have found that this is why my application won't close properly. I can explicitly set...
165
by: Dieter | last post by:
Hi. In the snippet of code below, I'm trying to understand why when the struct dirent ** namelist is declared with "file" scope, I don't have a problem freeing the allocated memory. But...
2
by: Jake Barnes | last post by:
Using javascript closures to create singletons to ensure the survival of a reference to an HTML block when removeChild() may remove the last reference to the block and thus destory the block is...
9
by: meerubus | last post by:
Hi, Could someone advise how to go about writing a (simple?) C++ program to block a windows exe file from running? For example, my child likes to run halo.exe & the pgm can run even in a...
4
by: kabradley | last post by:
Hello all, I'm using Access 2000 and have another question. I have a table that holds information about particular investments. Each investment has a LPName and an autonumber LPID. I have a form...
16
by: Richard Maher | last post by:
Hi, I have this Applet-hosted Socket connection to my server and in an ONevent/function I am retrieving all these lovely rows from the server and inserting them into the Select-List. (The on...
2
by: =?Utf-8?B?UG9sbHkgQW5uYQ==?= | last post by:
Hi, I am using the Exception Handling Application Block, which is lovely. I have been able to create a flat file as well as create an entry in the Event Log. However I am unable to create an...
6
by: Ty | last post by:
Here is another block that I can not get to convert. This is a class module. public bool IsAuthenticated(string domain, string username, string pwd) { string domainAndUsername = domain + @"\"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.