2

I need a way to make a php script that will launch on a certain page load that I do not own.
What I want to launch when the page is loaded is a modal that has a login screen.

For this to be possible I will need for tampermonkey/greasemonkey to run a php script(or something close to it) that will retrieve information from a sql server.

EDIT:

I would host my own sql server and users would login/register on to it. They would then use this login to hold their information.

David Ansermot
  • 6,052
  • 8
  • 47
  • 82
Cade
  • 41
  • 9
  • Send a HTTP request? – Huey May 03 '15 at 03:48
  • Could I get a wiki or a tutorial on how to do this maybe? – Cade May 03 '15 at 03:51
  • [HTTP GET request in JavaScript?](http://stackoverflow.com/questions/247483/http-get-request-in-javascript) could be useful. – Huey May 03 '15 at 03:53
  • You can perform an ajax request to an external domain if needed, but yes, you will still need to perform an ajax request, that's the only way you have to accomplish that, since javascript (and, so, even tampermonkey and greasemonkey) is a client side language while php is a server-side one. – briosheje May 22 '15 at 15:07

1 Answers1

1

I'm not really 100% sure what you're asking for here, but it's impossible to run PHP scripts on external websites, as PHP is a server-side language.

You also can't retrieve information from another website's MySQL Database without the login information to said Database, as well as access permissions (Databases often have a whitelist, and if you're not on it, you can't access it even with the information).

I'd need a little more info on what you want though, if it's something else. Sorry!

Chris Evans
  • 1,235
  • 10
  • 14
  • I think i edited it but what i plan on doing is using my own server just someone else's website more like a plug-in for said website – Cade May 03 '15 at 14:29
  • Without the permission of the other website, I can't see how this will be done. You could create your own register/login website/page and then use tampermonkey to run a userscript that shows up on the other website but it will only work for people who have the userscript installed on their browser. You can't affect another website without that. Also, this won't give people any functionality on the other website unless you make another whole array of userscripts allowing that too. – Chris Evans May 04 '15 at 01:01