How to do this, summarized in a gif

Arcanine

Newbie
Joined
Sep 18, 2019
Messages
25
Reaction score
8
qcJ7o.gif



When you click to view the image on site 1, it appears on site 2


Well, someone could guide me
 
hmm.. do you mean that the image from site2 should be show on site1 ?
 
Save the click event in a database, connect site2 to that database an either check automatically every X seconds or onload if the click has been submitted.
 
Save the click event in a database, connect site2 to that database an either check automatically every X seconds or onload if the click has been submitted.
Overthinking the problem like a NASA engineer. ;)

It would be simpler to use client side Javacsript and cookies.
 
Overthinking the problem like a NASA engineer. ;)

It would be simpler to use client side Javacsript and cookies.

Might be a bit simpler, really depends what that image is about, or better what action is required. If its low security, JS and Cookies could be "better", but also then not necessarily much easier than the database setup.
 
The same origin policy prevents one site from reading anothers cookies, thus, that is not a viable solution.

The sites would need to communicate through a backend in some way.

Websockets could be used if you want the event to trigger in real time.
 
Can be done easily using api, if you have accsess to both site
 
you would need a server to aggregate requests and probably websocket for realtime updates
 
Overthinking the problem like a NASA engineer. ;)

It would be simpler to use client side Javacsript and cookies.
What about cross-site scripting restrictions in modern browsers? What if site one is not under your control, only loaded that gif, e.g. as advertising banner?
 
Really good points guys! XSS could definitely be an issue, especially if only one of the sites is under your control. In that case a backend solution suggested by Ky0n or greydingo is a much more feasible solution.
 
Last edited:
Wot? When did you go to site 2? You were at site 1 clicking on porn thumbnail.
 
Back
Top