Re: status on Homepage



Armin Horner wrote:

hi ng.

I want to integrate a status on my (business) Homepage

It should look like:

Right now we're in the shop
.. are closed.

(.. we have different working hours between saison)


the status is in a text-file status.txt
1 or 0

I will change the status like:
http://www..../status/changestatus.php?on
http://www..../status/changestatus.php?off

is there a security-issue because i have to set the status file
writeable

how can i prevent someone else changing it

First of all, make sure the status.txt file is in a directory that's
inaccessible from the web (ie. only accessible via your scripts),
preferably one step below the webroot, although not required.

On all my PHP projects, I create a seperate directory called "inc" in
the webroot (or the root directory of my project). If Apache is used, I
place a .htaccess file containing the keyword "deny from all" in it.
Or, if IIS is used (which has happened on a rare occasion), I make sure
all outside access is denied for this directory from the IIS manager.
That way, I protect my code (as well as the base configuration) from
being exposed and/or accessed directly.

Second, make sure your changestatus.php script ONLY reacts to the "on"
or "off" keywords. Or any other keyword you'd like to use instead (such
as "open" or "closed").

Further, to avoid someone outside your organization from setting the
status (such as opening the URL and making it look like you're closed
when you're open for business or vice-versa), you should place this
script under some sort of password protection (either via your CMS or
via a simple basic authentication method).

--
Kim André Akerø
- kimandre@xxxxxxxxxxxxxxxxxx
(remove NOSPAM to contact me directly)
.



Relevant Pages

  • Re: Attempt to execute script radon as a function
    ... radon.m starts with a the function keyword. ... Radon function which is a part of image processing toolbox. ... "Attempt to execute script radon as a function in line number..." ...
    (comp.soft-sys.matlab)
  • Re: read text file
    ... I'm a Filemaker newbie. ... (one keyword per line), search each keyword in certain fields ... You would script a loop through all of the records in the Keyword ... create another field in Gene to set as a flag if the word is there. ...
    (comp.databases.filemaker)
  • Re: Support Groups
    ... A preposition is not a good word to end a sentence with! ... I understood he needed to go through a script. ... thought the main fan had failed and the script discovered it was the fan ... Go with the Small Business Group. ...
    (alt.sys.pc-clone.dell)
  • Re: Support Groups
    ... I understood he needed to go through a script. ... thought the main fan had failed and the script discovered it was the fan ... Go with the Small Business Group. ... the "Small Business" support group? ...
    (alt.sys.pc-clone.dell)
  • Re: Support Groups
    ... Those aren't periods, Irene. ... I understood he needed to go through a script. ... thought the main fan had failed and the script discovered it was the fan ... Go with the Small Business Group. ...
    (alt.sys.pc-clone.dell)