PHP to Access database using sms help needed!!!
Hi everybody,
I'm new at php I am strugling to get something working, my application sends a text message to a gateway and the gateway activates a service which is:
http://localhost/2way.php?sender=@@...ext=@@FULLSMS@@
The service takes in the first word in the text message and replies to the user with:
echo "I recieved your message : " . $_REQUEST['text'];
The following is my php code for 2way.php (it is very basic):
<?
header ("Content-Type: text/plain");
if (isset($REQUEST['sender'])) {
if (isset($REQUEST['text'])) {
echo "Your balance is : " . $_REQUEST['text'];
}
else {
echo "ERROR : 'text' parameter missing\r\n";
}
}
else {
echo "ERROR : 'sender' parameter missing!\r\n";
}
?>
My problem is that I need the application to access my database (login), I need to send a text message to the gateway with a username and it sends the username to the 2way php file and the php file accesses the database and returns a balance(float) coresponding to the username, and then sends the balance to the sender!! as in " echo "Your balance is : " . $_REQUEST['sender'];
I would be very grateful if some one could help me with this one,
Thanks for your time,
James