473,395 Members | 1,502 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,395 software developers and data experts.

How create a server switch

Hello,
i have a very easy html page with 2 distinct sections.
The first internet user (that load this page) must be execute both sections,the subsequent internet users must be execute ONLY the section 2.

How (i think) create a server switch for check if i'm the first internet user or subsequent?

Thanks !!!
Luciana
Oct 25 '13 #1

✓ answered by Nepomuk

Hi evvivame and welcome to bytes.com!

A typical web site will do nothing of the kind; every session started is supposed to be independent of the others. That said, there are of course tricks to do stuff like this but they will require server side programming.
One possible solution would be for the server to check whether a file with a certain name is present on the computer it's running on; if not it creates it. So, the first user will start a session without the file present and the second will start one with it present. This file could of course contain information (e.g. an IP address).

@Frinny: Uhm, I think one of us misunderstood the question. ^^

8 1455
Frinavale
9,735 Expert Mod 8TB
Set a cookie in the browser that never expires.
Check that cookie to determine what to display.
You probably need to use JavaScript to hide/display the appropriate sections according to whether or not the cookie is set.

-Frinny
Oct 25 '13 #2
Nepomuk
3,112 Expert 2GB
Hi evvivame and welcome to bytes.com!

A typical web site will do nothing of the kind; every session started is supposed to be independent of the others. That said, there are of course tricks to do stuff like this but they will require server side programming.
One possible solution would be for the server to check whether a file with a certain name is present on the computer it's running on; if not it creates it. So, the first user will start a session without the file present and the second will start one with it present. This file could of course contain information (e.g. an IP address).

@Frinny: Uhm, I think one of us misunderstood the question. ^^
Oct 25 '13 #3
Frinavale
9,735 Expert Mod 8TB
Yup the question is ambiguous.

I see where you are coming from but my answer could still be valid...

We will have to wait for clarification :)
Oct 25 '13 #4
Hi,
sorry if i was ambigous!!

I think EVERY internet user (that open my html page) work on DIFFERENT stations: this mean i can't use the cookie.
Example:
a) Frinavale open my web page and execute section 1&2
b) While Frinavale is on my page,Nepomuk open the same page and execute ONLY the sction 2

For more know:
section 1 start camera's patrol
section 2 display the camera
If all internet users start the section1, the camera crazy :))

Now i hope a bit clear

p.s. With my bad english i think Nepomuk on the right way....but isn't clear how improvement :(

Thanks very much for the support !
Oct 25 '13 #5
Frinavale
9,735 Expert Mod 8TB
Yeah that solution requires some server-side coding.

A while ago (years ago maybe??) I created a server-side application that connected DVR and every time it got an image from the DVR it pushed the image down to any connected clients.

There was only 1 connection to the DVR: my server component. This server component listened for connecting clients (web browsers hosting a SilverLight app) and every time it got a new image it would push the image down to each connected client.

I remember being excited about HTML5 at the time and it's promise of sockets but this feature wasn't implemented in any browsers at the time and my excitement wore off as I got involved in other projects.

Anyways, my point being that I had to create a server side application that connected to the "camera" so that not all the browsers were connecting to it directly (causing problems).

-Frinny
Oct 26 '13 #6
Finavale,
sorry for my stupid question:

A html page can create a file (as switch) on the webserver?

If yes can be easy check if this switch is on (execute ONLY section 2) or off ( set switch to on and execute Section 1 & 2) ?

Regards
Oct 26 '13 #7
Dormilich
8,658 Expert Mod 8TB
A html page can create a file (as switch) on the webserver?
no. a HTML page is not a programme, it’s just markup. and it’s only working on the client.
Oct 27 '13 #8
Frinavale
9,735 Expert Mod 8TB
As Dorm has stated, HTML is just a markup language that is used to describe how to render content in a browser.

This content can be dynamically generated by an application or script that is run on a web server. This server component can be coded using any web language (like php, asp, asp.net, java, perl etc. etc.)

This server component would load the camera and return the appropriate HTML content according to whether or not the camera is loaded.

-Frinny
Oct 28 '13 #9

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

Similar topics

1
by: Uma | last post by:
I am trying to conenct to tables in another database, but I get this error on the CREATE SERVER command: SQL1019N The node name specified is not valid The create server command looks...
9
by: jab | last post by:
Je veux lier (join) une table qui se trouve dans une database avec une qui se trouve dans une autre database. Les 2 databases sont sur le même serveur en l'occurence DB2/NT 7.2.9. J'ai créé un...
0
by: jk | last post by:
Hello, I have a problem creating a federated server in DB2/UDB V7.2.0 to DB2/VM V7.2.0. As you can see in the snapshot of the db2diag.log DB2 is returning an internal error: Instance:DINST ...
6
by: Dave | last post by:
Hello there. I'm interesting how do I create server side menu in ASP.NET, I was searching for some menus, but they are all done with DHTML or JavaScript, so I have some problems to use them. I...
2
by: Steve Richter | last post by:
I like the idea of being able to place server controls in an assembly and use them in all of my web applications. On the other hand I like the ease of using an .ascx file when I write user...
3
by: fyi85 | last post by:
I am trying to create a server on the same machine running the same instance. This is v8.1.5 on Windows 2003 Server. The instance is set to FEDERATED=YES The server will be created for database...
1
by: Dharmaraju | last post by:
I have developed one vb.net application. I have around 25 computers and one server . I want to deploy that application to all the machines. I want to access the vb.net application from...
3
by: dfluker | last post by:
Here is my code:<title>Dom demo</title> <script type="text/javascript"> function changeText() { var Temp = document.getElementById('first').innerHTML= 'Second Entry'; ...
0
by: aviator08 | last post by:
i am working on a project on JAVA Lan messenger. i hav written all d code required. but i can't connect my database server on netbeans. show me how create a server in ODBC driver and how to...
0
by: adititiwari | last post by:
Hi, I issued a command: create server p400 type db2/400 version 5.3.0 wrapper DRDA authorization "qseibm" password "ibm***" options (node 'S657686B', dbname 'S657686B') for an already...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...

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.