I am working on a script (page is called sms_page.php) that is supposed to run when a registered user sends an sms with their user number. The sms central then calls this script and it (should) update the database and give the user access to another usergroup.
I havenĀ“t dared to try it yet, so all feedback is appreciated!
What do you think? Will this work?
This is what the sms server sends to the script:
sms_page.php?sms=the+text+that+has+been+sent&nr=070XXXXXXX
<br />$db_conn=mysql_connect("localhost","user","passw"); <br />mysql_select_db("forum_db",$db_conn); <br /> <br /> <br />$sms = $_GET['sms']; // Contains the text - the sent user number <br />$nr = $_GET['nr']; // Contains the phone number <br /> <br />$result = mysql_query("SELECT id FROM w3t_Users WHERE U_Number='$sms' LIMIT 1"); <br /> <br /> <br />$member=mysql_num_rows($result); <br /> <br />if(!$member) <br />{ <br />echo "The user number You provided does not exist in this community!"; <br />} <br /> <br /> <br />else <br />{ <br />$id=mysql_result($result,0); <br />$update = mysql_query("UPDATE w3t_Users SET U_Groups=-5- WHERE id='$id'"); <br />echo "You are now a VIP member!"; <br />} <br /> <br /> <br /> <br />mysql_quit($db_conn); <br />