Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $dbhost = 'localhost';
- $dbuser = 'user';
- $dbpass = 'password';
- $conn = mysql_connect($dbhost, $dbuser, $dbpass);
- if(! $conn ) {
- die('Could not connect: ');
- }
- $request = file_get_contents('php://input');
- $input = json_decode($request, true);
- mysql_select_db('contacts1');
- $count = count($input);
- for ($i = 0; $i < $count; $i++) {
- $mName = $input[$i]['SoftID'];
- $mNumber = $input[$i]['Function'];
- $mId = $input[$i]['Id'];
- $mTheNumber = $input[$i]['TheNumber'];
- $mTheName = $input[$i]['TheName'];
- $mTheDate = $input[$i]['TheDate'];
- $mTheDirection = $input[$i]['TheDirection'];
- $mTheText = $input[$i]['TheText'];
- $sql = 'INSERT INTO sms '.
- '(TheNumber,TheName,TheDate,TheDirection,TheText) '.
- 'VALUES ( "'.$mTheNumber.'" , "'.$mTheName.'" , "'.//$mTheDate.'" , "'.$mTheDirection.'" , "'. $mTheText.'")';
- $retval = mysql_query( $sql, $conn );
- if(! $retval ) {
- die('Could not enter data');
- }
- }
- echo "SMS";
- mysql_close($conn);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement