Page 1 of 1

Ideas for two different websites communicating

Posted: Thu Nov 13, 2008 9:54 am
by joachimseitz
Hello,

What I want to do is send a request to an external site which has a php script. like: externalsite.com/check.php?user=joachimseitz
the check.php checks if this user exists (but the data should not be seen by anyone which is sent (the user=1 variable == data)) and if it does it gives me an yes=1 in whichever way (post?? or back to my page redirecting like: mypage.com/doexternalcheck.php?exists=yes)

The data is in an mysql databse which of coursecan not be accessed form somewhere else. (I don't want external access to the mysql server!! since many people should be able to use this script) I basicly want to write a script where other people can check if the username is already taken.


I have searched and I did not find anything suitable, I am not even sure which keywords to use. Maybe I should use Java Script to do the check??

This script is for a online simulation. I just code for fun ;)

I want some suggestions of any kind, what keywords should I search for, links to tutorials or php functions whatever... any ideas?


sort of the short version up there cause im not sure if other people will understand the problem here a longer version :/

I want to write a Mod/Hack for a Bank script, so that people can pay money from external sites and these external site can check if they REALLY got their money, in their account. The script that sends the money is written already and works. But I want to write a script which checks if the money from this user really arrived. so like: xxx.php?money=100&fromuser=23&touser=55&secretkey=xyz and if it returns true somehow my script find this out and automaticly give the user access to the game (for example a small game or video) immediately without me having manualy to check if the user has paid the money and then giving him permission to play the game. Since this script should not be misused I will use a password so the request to see if "user 55" got money from xx can only be processed if the script knows his password (or "check key") but this key should not be seen by any user!

they only idea i have atm is:
the site has xml file(or normal text file whatever) with the account transactions which anyone can access. but the site is encrypted which can only be read if you have the secret key
then the script could import this data in the xml file and decrypt it and check if the transaction had been made (comments?)

btw. since this is only for a simulation this doesnt not have to be totally secure since no real money is used and no real damage will be done but it should be secure as possible, just secure enough and as simple as possible

Re: Ideas for two different websites communicating

Posted: Thu Nov 13, 2008 12:53 pm
by Jenk
News Flash: This is the sort of thing the HTTP protocol was invented for..

Re: Ideas for two different websites communicating

Posted: Sun Nov 16, 2008 12:22 am
by califdon
Divide your problem up into its component parts. You seem to be running a whole bunch of concepts together, which will get you nowhere fast.

PHP is server side scripting, and Javascript is browser side scripting, so if you're going to check something in a database, PHP is what you have to use.

All your illustrations imply GET method, but almost surely you don't want to send sensitive data in the URL, where everybody can see the values. POST would be the appropriate method to pass your data in the headers, not in the URL.

Keep your user forms and their data separate in your mind from what you are going to do with the data when it is received at the server. Tackle one part of the problem at a time. Learn how to send form data with the POST method, how to receive it in a PHP script, and how to check it against a database, if that's what you need to do.

When you are able to do all that and understand how it works, then you can decide what you want to send back to the browser to notify the user of whatever you want. That's just HTML, unless you're going to do something fancy after that.

A good place to start reading tutorials is http://w3schools.com