Detect fake user Agents? [closed] - javascript

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
Is it possible to recover if someone is visiting my website using a fake user agent? If yes, can someone please tell me how can find out this information?
Thank you very much!

You can check the user agent from PHP like from this global variable $_SERVER['HTTP_USER_AGENT']. But if someone is using a fake user agent which claims to be something else* it's going to be difficult to spot.
This shouldn't really matter unless they are a hacker who is able to find some security weaknesses in your site and use those to do something nasty like access your database, delete all your data or download your users' credit card numbers.
The solution to the hacker problem is make sure your website is secure.
This is called 'spoofing' as #JAL mentions in his comment above.

Related

Place Cookie to prevent re-visiting site [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
I have a contest site, I want it to prevent people going on it when they have submitted the form on the page. Is this possibe?
Thanks
You could build system where users are required to enter their email address, and enter a verification code which is sent to them. But they would only be able to enter this verification code once. Therefore, the only way of cheating would be to use two separate email addresses (and they would have to have access to both).
Cookies would not be the best option for this as anyone could clear their cookies.
It's not necessarily possible to stop users requesting a page, however you can either redirect them to another page or show some kind of error message to them, to tell them that they can't resubmit.
Presuming you have some kind of user registration in place already (and are tying competition entries to those users with an ID) then all you would have to do is check for the existence of a competition entry in the database and then, if one is found, either force a redirect (likely in <script> tags) or replace the rendering of the page with the notice that you can't resubmit.

how to find user is logged in different browser or different system at a time using php [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I am implementing Online Examination System. If user is logged in different browsers at a time it should not be logged in. As well as Different system. Please help me how to restrict the user logging in different browsers. Please give any Example Code. So that i can understand easily. Thanks in Advance.
Try the following logic:
You can keep the username of logged in users in a list. Then each time a new login is made, check if the user is in that list. If it is, then redirect him to the error page else let hime proceed with examination. On logout you will remove the user from the list.

how can I disable copying images from browsing my website [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
There is an option for disabling right click on the website on the computer but on the mobile I don't know which javascript code I would need.
Images have to be copied from the web server to the client system in order for the client system to display them.
There is no way to stop people from saving them.
There is an option for disabling right click on the website
Not one that can't be trivially bypassed.
There's no way to actually block an image from being copied. If it's being shown to the user, they can obtain it. The resource is already sent to them for render anyways.

How to make an event when there is a refresh [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I'm making a web-quiz, there are the users logged in this game and they have to reply to a quiz with 3 alternatives, the problem comes when the user is a bit clever because if he does a refresh all the question change so the user can do this until he find the one that he knows, how can I put in my website (after an alert) wrong question?
example:
USA is in EU
UK is in Africa
France is in EU
If the users does a refresh, how can I show message such as alert("if you refresh is a game over") and save the answer as incorrect in the database?
I'd suggest assigning the question in PHP and storing which question you asked in a $_SESSION variable. That way when they refresh the page you can show them the same question until they answer it.
UPDATE
There is a caveat to this, if your user really is a smarty, they can delete their cookies and refresh the page, which would create a new session for them since session identifiers are saved as a cookie in PHP (by default).

Synchronous changes to webpages useing javascript [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
This is most likely a very simple question but i am new to server-client programming i am used to only a client. I want an action that is taken on one person's browser to effect the state of the screen to all people that are looking at it.
I doubt it is that hard but i have no idea. And after some googling i can't find anything.
Take a look at websockets, which allow you to open up a constant connection between the client and the server.
Basically you will need the "host" to send its screen data to the server via websocket (or possibly AJAX), which can then transfer the data to the "viewers" (which is where the websockets will be superior to AJAX).

Categories

Resources