How to have 2 header in one file to give the auto reply in 2 condit... | Search |
NowSMS Support Forums ⬆ NowSMS Support - SMS Issues ⬆ Archive through July 28, 2010 ⬆ |
◄ ► |
Author | Message | |||
Shinichi Akira New member Username: Ryou_yonathan Post Number: 3 Registered: 03-2010 |
Dear Admin, I am having difficulty in applying the auto respond for my application. I intend to give 2 type of autoreply SMS. first, if the inputted data is right for the registration, the system will reply that the data already correct and also reply the the idmember. but if the data is wrong or not according to the requirement, the system will reply that the SMS format is wrong, etc. example: <?php $sql1 = "INSERT INTO jos_inbox (SMSID, sender, prefix, content) VALUES ('', '$sender', '$prefix', '$content')"; $result = mysql_query($sql1); $message = explode("#",$content); //to prevent the wrong input from user $countarray = count($message); if ($countarray==6) { $fullname = $message[0]; $address = $message[1]; $contact = $message[2]; $idnumber = $message[3]; $city = $message[4]; $province = $message[5]; $year = date('y'); $month = date('m'); $getsequence = "SELECT sequence FROM jos_sequence WHERE SID='1'"; $resultsq = mysql_query($getsequence); $row = mysql_fetch_array($resultsq); $currentsq = $row[0]; $currentsq = $currentsq + 1; $updatesequence = "UPDATE jos_sequence SET sequence = '$currentsq'"; $update = mysql_query($updatesequence); $newsequence = $currentsq."<br />"; $ProviderID = $year.$month.$newsequence; $sql2 = "INSERT INTO jos_providerdata (ProviderID, fullname, address, contact, idnumber, city, province) VALUES ('$ProviderID', '$fullname', '$address', '$contact', '$idnumber', '$city', '$province')"; $result2 = mysql_query($sql2); header("Location:http://127.0.0.1:8800/?PhoneNumber=$sender&Text=Thank+you+for+registering.+Your+IDMember+is+$ProviderID"); }else header("Location:http://127.0.0.1:8800/?PhoneNumber=$sender&Text=Sorry,+your+SMS+is+wrong"); ?> but, there will be an error because 1 have 2 header in 1 file. may be there is a special syntac for that. thank in advance. warm regards, Nathan | |||
Shinichi Akira New member Username: Ryou_yonathan Post Number: 4 Registered: 03-2010 |
anybody could help me? | |||
Des - NowSMS Support Board Administrator Username: Desosms Post Number: 2076 Registered: 08-2008 |
Hi Nathan, Sorry for the delay in response. Don't use the "Location" header. Instead, initiate a new HTTP connection back to the NowSMS server for each message that you want to send. sendsms.php is a handy function that will simplify this process for you. http://blog.nowsms.com/2008/10/nowsms-php-example-send-sms-text.html -- Des NowSMS Support |