Welcome to WebmasterWorld Guest from 54.163.84.199

Forum Moderators: ocean10000

Problem with server side includes

Problem with server side includes

   
4:28 am on Nov 28, 2002 (gmt 0)

10+ Year Member



Hello folks.

The hosts of my chat room can type in a password protected url to change the room status to "open" or "closed". This is supposed to change several things at once, including the image site wide that displays the chat room status.

This page itself is working fine. The variable is changed in a text file. This text file is included into settings.asp and then settings.asp is included in all the other relevant pages, is doesn't seem to be having an effect though.

settings.asp is getting included, but the chat status file included into that appears as if it is not included, although it must be!

There are no errors so the code should be getting included, chatStatus="open" for example. For the page which re-directs users accordingly, no re-direction is taking place. I've played around with the coding a lot, but to no avail.

Originally I would ftp the settings.asp file whenever a change in the chat rooms status occured. However, this is not suitable for my hosts and in the long term isn't really an efficent method.

The problem is probably something really simple, that's always the way!

1:23 am on Nov 29, 2002 (gmt 0)

WebmasterWorld Senior Member korkus2000 is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Why not have a setting in a database instead of using a text file?
12:45 pm on Nov 29, 2002 (gmt 0)

10+ Year Member



What about using a cookie? If you're referring to a local variable in an include file, it will be re-initialized every time the page loads. Use a cookie or Session variable.
8:05 pm on Nov 29, 2002 (gmt 0)

10+ Year Member



I know someone would mention databases.

The reason I'm using a text file is that I'm only just getting into databases and the info is only one little piece of data.

In terms of security with holding the variable in a text file, well it's in a url secured area so that's okay.

I'll look into using a session variable,

6:19 pm on Dec 8, 2002 (gmt 0)

10+ Year Member



Could the problem you're having be caused by pages being cached in the browser so that the updated status text file doesn't take effect?

If so there is another Webmaster World discussion that suggests something you might try:
<%
Response.Expires = -1
Response.Expiresabsolute = Now() - 2
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "no-cache"
%>

(before the html tag).

 

Featured Threads

Hot Threads This Week

Hot Threads This Month