Referrer to get previous page it isn't working always [closed] - javascript

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
My problem is Referrer to get previous page it is not working right for example if i open my PHP website from google
document.referrer
working right and i get google link but if i open my website from Bing
referrer returns null . I don't know why ? my web site is https . and i need to get from where user come to my website so any body know the reason

You should not rely on referrer, it's a just a HTTP header which may not be included in the request. Here are some cases where document.referer will be empty:
enter site directly
enter site from bookmarks
browser settings
redirect from http <-> https
etc.

Related

Is it possible to restrict user from to bookmark a specific web page? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I am developing a webpage with Python(Django) and want to restrict users from to be able to bookmark a specific web page. Is there a solution?
Bookmarks are Browser specific and you cannot intervene with what the user can do with the browser outside of your web application.
If you do not want the user to access the webpage directly, you can implement Authorization with Session IDs to prevent direct access to the specific webpage.
The answer is no, the user can always bookmark a page because it is a browser function.
But you can use sessions. Then make sure that any page request must have an active session ID, otherwise, it will return an error or redirect to the home page.
The user can add a bookmark to the page, but the bookmarks will only work for limited time. He won't able to access the page after the session timeout. This also has the added benefit of making the site impossible to index by the search engines.

how use variable from iframe to another iframe in different domain? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I see this video when the minute 1:49 the user click a button of the color of iframe 2 and change the iframe 1
https://www.youtube.com/watch?v=4nSjykKMi8g
what type of technique could i use for get this
please help me
The frames can't communicate directly but you can communicate via a server you control. This server can be on any domain.
You can push events using AJAX and receive events using server-sent-events. Make sure you're dealing with the cross domain requests appropriately by implementing CORS on the server.

Detect if user is directed from you website [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I want to play an animation when you are not redirected from my page (when you have not clicked a link on My page and got redirected to another page on My page) much like: animade.tv
It there any way to detect that with javascript? If not, can you do it with php?
You can use both js or php
js:
document.referrer
php:
$_SERVER['HTTP_REFERER']
sometimes it could be empty, you can just verify that is different from your domain
use document.referrer to test the url

Which php/js functions does this website probably user in order to autorefresh itself? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
This webpage http://cml.kg/test.php refreshes 10som.kg.
1. How does test.php embed 10som.kg even though 10som.kg
uses x-frame-options : SAMEORIGIN?
Doesn't it mean that you can't embed it on any other website? How did test.php bypass this restriction?
2. Test.php doesn't only refresh the embedded page, but also clicks the button on it until the URL changes. How?
Thanks in advance!
For your question 1. 10som.kg probably has CORS enabled in the server.
http://en.wikipedia.org/wiki/Cross-origin_resource_sharing
If that's true, this allows other domains to make ajax request to it.
Hope this helps. Cheers

Is there a way to control an email service like yahoo using javascript? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I am making an open-source addon for firefox and chrome called and I am wondering if there is a way to control an email service like yahoo using javascript?
You can control the look of the page and probably (although I cannot be sure) send and edit messages without having to use the on-page buttons, but you cannot do server-side stuff such as logging into an account from a page without a log-in on it or sending a message from a page other than the email sending page. If you have any specific questions about controlling one specific thing, please add them in the comments, and I may answer them.

Categories