It occurs to me in hindsight that I was massively overthinking this - it's perfectly possible to pass data from one page to another via the querystring, and intercept that using JavaScript on the target site. Note, however, that this is not a secure means of passing data and should not be used for private information. Let's return to our form on web site A:
<formmethod="get"action="https://your-second-website-url-goes-here.test/"><labelfor="numberInput">Enter a number:</label><br><inputtype="number"id="numberInput"name="numberInput"><br><inputtype="submit"value="Submit"></form>
Note that the method has changed from post to get inside the form tag. This will convert the user input inside the form into a querystring, which will take the form:
Getting the values from a querystring has multiple solutions (I have to admit, I've not used Proxy() before). But this will allow you to reflect user choices on one site on a completely different domain, albeit with a JavaScript dependency. And you don't need to touch server-side code.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
It occurs to me in hindsight that I was massively overthinking this - it's perfectly possible to pass data from one page to another via the querystring, and intercept that using JavaScript on the target site. Note, however, that this is not a secure means of passing data and should not be used for private information. Let's return to our form on web site A:
Note that the
methodhas changed fromposttogetinside theformtag. This will convert the user input inside the form into a querystring, which will take the form:https://your-second-website-url-goes-here.test/?numberInput=5(assuming the user types
5into the input field)Getting the values from a querystring has multiple solutions (I have to admit, I've not used
Proxy()before). But this will allow you to reflect user choices on one site on a completely different domain, albeit with a JavaScript dependency. And you don't need to touch server-side code.