Previous Thread
Next Thread
Print Thread
Rate Thread
#273561 05/19/2004 1:16 PM
Joined: Sep 2002
Posts: 151
Member
Member
Offline
Joined: Sep 2002
Posts: 151
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

Code
 <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 /> 

Last edited by Gregori; 05/19/2004 1:25 PM.
Sponsored Links

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
badfrog
badfrog
somewhere on the coast of Maine
Posts: 94
Joined: March 2007
Forum Statistics
Forums63
Topics37,575
Posts293,930
Members13,823
Most Online6,139
Sep 21st, 2024
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2025 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.1
(Snapshot build 20240918)