0

I'm currently working on a solution in php which queries an sql database. However, i want other website to be able to query the database (or the functions in php). I search google, but i can't find out how to expose these functions to javascript due to crossdomain policies(i think).

Anyone know how I can do that?

Friso Kluitenberg
  • 1,157
  • 1
  • 14
  • 34

4 Answers4

3

Try soap or rest.

If I understood right... if you want other sites to access your Database... Obviously...use jQuery :p to make the calls

Chris Tonkinson
  • 13,823
  • 14
  • 58
  • 90
ka_lin
  • 9,329
  • 6
  • 35
  • 56
1

If Cross-Domain is your only concern, check out JSONP. You can also check the tag to learn more.

gen_Eric
  • 223,194
  • 41
  • 299
  • 337
Aleksandar Vucetic
  • 14,715
  • 9
  • 53
  • 56
0

Sounds to me like you're inadvertently writing a web API. REST is hot these days, for good reason (they play well with javascript clients, for one).

Here is a thread that should give you lots to chew on.

Community
  • 1
  • 1
dsummersl
  • 6,588
  • 50
  • 65
0

you could build a rpc server (remote-procedure-call). It could be either xml-rpc or json-rpc.
Here are some good documentations

gion_13
  • 41,171
  • 10
  • 96
  • 108