943,769 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 577
  • PHP RSS
Apr 14th, 2008
0

Letting other website access my database?

Expand Post »
hi all,

i'm almost done with the program im doing. one last thing i must do is to implement a search box dropdown on the other website with a dynamic content coming from our database. prob is, of course i dunno how to do that? xD

is
PHP Syntax (Toggle Plain Text)
  1. require_once("http://www.mywebsite.com/include/db_connect.php")
will do? i'll be experimenting later, but i need some idea so it wont take long..

im also concern with security...

any help?

im using cPanel bdw..
Reputation Points: 10
Solved Threads: 1
Light Poster
upstream is offline Offline
43 posts
since Sep 2007
Apr 19th, 2008
0

Re: Letting other website access my database?

first: you could try to access your databse directly (eg. mysql_connect("http://www.blah.com"); ). But that's in most cases restricted.

so you better do it this way:
write a simple php-routine and put it on the server where your database is running. Select all data you want to display on the other one and just echo them so that you get a plain text.
On the other server you can get these data with pfsockopen (http://de3.php.net/manual/en/function.pfsockopen.php).
For security you can have a simple password that you send via HTTP (a bit unsave though). If it's not enough then crypt it with MD5 or RSA (see wikipedia).

One more thing: pfsockopen is also restricted on some server. So try it out before you do all the fuss with coding.
Last edited by sDJh; Apr 19th, 2008 at 5:25 pm.
Reputation Points: 56
Solved Threads: 29
Posting Whiz in Training
sDJh is offline Offline
255 posts
since Aug 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: ooccurence of a string in a file
Next Thread in PHP Forum Timeline: favicon.ico was not found





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC