473,666 Members | 2,412 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Am getting the error " Bad Request HTTP Error 400"

tharini
9 New Member
Whenever i run my SMS API code,am getting the error " Bad Request HTTP Error 400.The Request is badly formed". When i store a particular mobile number in database and send sms to that mobile no.,the msg is sent successfully only for few times after that am getting the above mentioned error msg.

I dont understand why the msg is not sent to the same mobile number few days after storing in databese...I have given my sms code below.Can anyone give me some better suggestions?


Expand|Select|Wrap|Line Numbers
  1.  
  2. <?php
  3. if(isset($_POST['send']))
  4. {
  5. $member=$_POST['member'];
  6. $message=$_POST['message'];
  7. mysql_query("insert into send_message(send_to,message) values('".$member."','".$message."')") or die(mysql_error());
  8. if($member=="All")
  9. {
  10. $get_members=mysql_query("select * from member_details" ) or die(mysql_error());
  11.       $get_members_num=mysql_num_rows($get_members);    
  12.  $i=0;
  13. while(  $get_members_row=mysql_fetch_array($get_members))
  14.       {
  15.  
  16.      if($i==0)
  17.      {
  18. $mobile2=$get_members_row['mobile'];
  19. $message="Dear Rtn.".$get_members_row['name'].", ".$_POST['message'];
  20. echo $mobile2;
  21.  
  22.  
  23. //Change your configurations here.
  24. $username="20032757";
  25. $password="kqpt4e";
  26. $sender="arun";
  27. $domain="www.ciainfomedia.com";
  28. $method="POST";
  29.  
  30.  
  31.  
  32. $username=urlencode($username);
  33. $password=urlencode($password);
  34. $sender=urlencode($sender);
  35. $message=urlencode($message);
  36.  
  37.  
  38.  
  39. $url = "http://www.sendindiasms.com/sendurlcomma.asp?user=20032757&pwd=kqpt4e&senderid=ABC&mobileno=$mobile2&msgtext=$message";
  40. $ch = curl_init($url);
  41. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  42. $curl_scraped_page = curl_exec($ch);
  43. curl_close($ch);
  44. echo $curl_scraped_page;
  45. $i=1;}
  46. if($i==1)
  47.      {
  48. $mobile2=$get_members_row['wife_mobile'];
  49. $message="Dear Ann.".$get_members_row['wife_name'].", ".$_POST['message'];
  50. echo $mobile2;
  51.  
  52.  
  53. //Change your configurations here.
  54. $username="20032757";
  55. $password="kqpt4e";
  56. $sender="arun";
  57. $domain="www.ciainfomedia.com";
  58. $method="POST";
  59.  
  60.  
  61.  
  62. $username=urlencode($username);
  63. $password=urlencode($password);
  64. $sender=urlencode($sender);
  65. $message=urlencode($message);
  66.  
  67.  
  68.  
  69. $url = "http://www.sendindiasms.com/sendurlcomma.asp?user=20032757&pwd=kqpt4e&senderid=ABC&mobileno=$mobile2&msgtext=$message";
  70. $ch = curl_init($url);
  71. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  72. $curl_scraped_page = curl_exec($ch);
  73. curl_close($ch);
  74. echo $curl_scraped_page;
  75. $i=0;}
  76. }
  77. }
  78. else if($member=="Members Only")
  79. {
  80. $get_members=mysql_query("select * from member_details" ) or die(mysql_error());
  81.       $get_members_num=mysql_num_rows($get_members);    
  82. while(  $get_members_row=mysql_fetch_array($get_members))
  83.       {
  84.  
  85.      if($get_members_row['member']=="Husband")
  86.      {
  87. $mobile2=$get_members_row['mobile'];
  88. $message="Dear Rtn.".$get_members_row['name'].", ".$_POST['message'];
  89. echo $mobile2;
  90.  
  91.  
  92. //Change your configurations here.
  93. $username="20032757";
  94. $password="kqpt4e";
  95. $sender="arun";
  96. $domain="www.ciainfomedia.com";
  97. $method="POST";
  98.  
  99.  
  100.  
  101. $username=urlencode($username);
  102. $password=urlencode($password);
  103. $sender=urlencode($sender);
  104. $message=urlencode($message);
  105.  
  106.  
  107.  
  108. $url = "http://www.sendindiasms.com/sendurlcomma.asp?user=20032757&pwd=kqpt4e&senderid=ABC&mobileno=$mobile2&msgtext=$message";
  109. $ch = curl_init($url);
  110. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  111. $curl_scraped_page = curl_exec($ch);
  112. curl_close($ch);
  113. echo $curl_scraped_page;
  114. }
  115. else if($get_members_row['member']=="Wife")
  116.      {
  117. $mobile2=$get_members_row['wife_mobile'];
  118. $message="Dear Ann.".$get_members_row['wife_name'].", ".$_POST['message'];
  119. echo $mobile2;
  120.  
  121.  
  122. //Change your configurations here.
  123. $username="20032757";
  124. $password="kqpt4e";
  125. $sender="arun";
  126. $domain="www.ciainfomedia.com";
  127. $method="POST";
  128.  
  129.  
  130.  
  131. $username=urlencode($username);
  132. $password=urlencode($password);
  133. $sender=urlencode($sender);
  134. $message=urlencode($message);
  135.  
  136.  
  137.  
  138. $url = "http://www.sendindiasms.com/sendurlcomma.asp?user=20032757&pwd=kqpt4e&senderid=ABC&mobileno=$mobile2&msgtext=$message";
  139. $ch = curl_init($url);
  140. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  141. $curl_scraped_page = curl_exec($ch);
  142. curl_close($ch);
  143. echo $curl_scraped_page;
  144. }
  145. }
  146. }
  147. else if($member=="Annets")
  148. {
  149. $get_members=mysql_query("select * from member_details" ) or die(mysql_error());
  150.       $get_members_num=mysql_num_rows($get_members);    
  151. while(  $get_members_row=mysql_fetch_array($get_members))
  152.       {
  153.  
  154. $mobile2=$get_members_row['wife_mobile'];
  155. $message="Dear Ann.".$get_members_row['wife_name'].", ".$_POST['message'];
  156. echo $mobile2;
  157.  
  158.  
  159. //Change your configurations here.
  160. $username="20032757";
  161. $password="kqpt4e";
  162. $sender="arun";
  163. $domain="www.ciainfomedia.com";
  164. $method="POST";
  165.  
  166.  
  167.  
  168. $username=urlencode($username);
  169. $password=urlencode($password);
  170. $sender=urlencode($sender);
  171. $message=urlencode($message);
  172.  
  173.  
  174.  
  175. $url = "http://www.sendindiasms.com/sendurlcomma.asp?user=20032757&pwd=kqpt4e&senderid=ABC&mobileno=$mobile2&msgtext=$message";
  176. $ch = curl_init($url);
  177. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  178. $curl_scraped_page = curl_exec($ch);
  179. curl_close($ch);
  180. echo $curl_scraped_page;
  181. }
  182. }
  183. else
  184. {
  185.  $get_members=mysql_query("select * from member_details where name='".$member."' or wife_name='".$member."'") or die(mysql_error());
  186.       $get_members_num=mysql_num_rows($get_members);    
  187.           while(  $get_members_row=mysql_fetch_array($get_members))
  188.       {
  189.      if($get_members_row['name']==$member)
  190.      {
  191. $mobile=$get_members_row['mobile'];
  192. $message="Dear Rtn.".$member.", ".$_POST['message'];
  193. echo $mobile;
  194. echo $message;
  195.  
  196. //Change your configurations here.
  197. $username="20032757";
  198. $password="kqpt4e";
  199. $sender="arun";
  200. $domain="www.ciainfomedia.com";
  201. $method="POST";
  202.  
  203.  
  204.  
  205. $username=urlencode($username);
  206. $password=urlencode($password);
  207. $sender=urlencode($sender);
  208. $message=urlencode($message);
  209.  
  210.  
  211.  
  212. $url = "http://www.sendindiasms.com/sendurlcomma.asp?user=20032757&pwd=kqpt4e&senderid=ABC&mobileno=$mobile&msgtext=$message";
  213. $ch = curl_init($url);
  214. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  215. $curl_scraped_page = curl_exec($ch);
  216. curl_close($ch);
  217. echo $curl_scraped_page;}
  218. else if($get_members_row['wife_name']==$member)
  219.      {
  220. $mobile=$get_members_row['wife_mobile'];
  221. $message="Dear Ann.".$member.", ".$_POST['message'];
  222. echo $mobile;
  223.  
  224. //Change your configurations here.
  225. $username="20032757";
  226. $password="kqpt4e";
  227. $sender="arun";
  228. $domain="www.ciainfomedia.com";
  229. $method="POST";
  230.  
  231.  
  232.  
  233. $username=urlencode($username);
  234. $password=urlencode($password);
  235. $sender=urlencode($sender);
  236. $message=urlencode($message);
  237.  
  238.  
  239.  
  240. $url = "http://www.sendindiasms.com/sendurlcomma.asp?user=20032757&pwd=kqpt4e&senderid=ABC&mobileno=$mobile&msgtext=$message";
  241. $ch = curl_init($url);
  242. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  243. $curl_scraped_page = curl_exec($ch);
  244. curl_close($ch);
  245. echo $curl_scraped_page;}
  246. }
  247.  
  248. }
  249. }
  250.  
  251. ?>
  252.  
  253.  
Sep 14 '10 #1
0 1699

Sign in to post your reply or Sign up for a free account.

Similar topics

1
5071
by: Phil Powell | last post by:
Here is the function ArraySearch: '-------------------------------------------------------------------------------------- 'ArraySearch will return an integer value indicating the first occurrence of a string 'within an array. for now it only does a case-sensitive first-occurrence search. ' 'Created by Phil Powell on 6/28/2002 '--------------------------------------------------------------------------------------
5
7395
by: Michelle Kinsey-Clinton | last post by:
Hello, I am writing an ASP app which is giving me some very frustrating errors. They appear intermittently, no real pattern to them, and often go away if you reload, or back up a few pages and start over again. The first error is logged as a 400 error and says only, "The parameter is incorrect." It (mostly, but not always) happens upon submitting a form, and a reload is generally successful in bringing the page up just fine. I have...
1
11072
by: Alex Maghen | last post by:
I'm getting the error "HTTP Error 403.1 - Forbidden: Execute access is denied" when I try to reach my ASPX pages. Before I go giving Windows permissions to my docroot, etc., I want to understand what users or, preferably, groups, need to have what permissions for basic operation of ASP.NET 2.0. And specifically WHAT permissions should I give these users?
1
4292
by: Mani | last post by:
Hi, This is the second time i am posting this question, since i didnt get any reponse from my previous post. When i tried to execute the script in browser, i am getting the following timeout error in the browser: -------------------------------------------------------------------------------------
3
2120
by: John Nagle | last post by:
I'm getting a wierd error from urllib2 when opening certain URLs. The code works for most sites, but not all of them. Here's the traceback: InfoSitePage EXCEPTION while processing page "http://www.fourmilab.ch": Problem with page "http://www.fourmilab.ch": HTTP error -1 - .. Traceback (most recent call last): File "D:\projects\sitetruth\InfoSitePage.py", line 318, in httpfetch fd = url_opener.open(self.requestedurl) #...
1
11206
by: jyoti202 | last post by:
Hi, Need help for this as i have been looking for it but could not get any results. We are using java as front end and DB2 as backend, i m getting the exception while executing a particular query with following error description: DB2 SQL error: SQLCODE: -901, SQLSTATE: 58004, SQLERRMC: sqlno_itr_plan::next :rc( 0) SQLCODE: -901 this error code says "Non severe System error" This query was working fine till...
11
8321
by: jjw92 | last post by:
I've been banging my head against the wall with this one for a couple days so I'm hoping someone has some ideas. I have a web service that I created that is called by a .NET class library (which in turn is called by another application). This all works fine in my development environment. Test environment: Windows Server 2003, ASP 6.0, .NET 2.0, Anonymous authentication is enabled. All components (web service, DLL, and calling application)...
1
5446
by: chrisj | last post by:
I'm using freeASPupload and got some assistance integrating to a Member script. It works successfully. In this modified version there are two groups that use this upload script. Members of one group get automatically re-directed after uploading. However, this member group never gets the benefit of knowing if they've uploaded an incorrect file size or incorrect file extension. Members from the second group do see the "exceeds max file...
1
7043
by: bruce | last post by:
i'm getting the following error: mechanize._response.httperror_seek_wrapper: HTTP Error 500: i'm running python 5.1 and mechanize 0.1.7b I have no idea as to what I have to change/modify/include to handle this issue. The link that I'm testing is at the bottom of the page. When I insert the link into the browser, I actually get an err page.. so, I suspect that there is a handler that I should be able to modify/use to handle this
15
7889
denny1824
by: denny1824 | last post by:
I have a working website. I copied all the files to a new folder in inetpub/wwwroot and then set that folder as a Virtual Directory in IIS. I try going to that site from the new folder and i am getting a default error page. It is an aspx page that I am trying to view. If I put in a fake page name it gives a different error about that fake name not existing, which means to me that it is seeing the page I want to view but is giving an error...
0
8440
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8352
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8549
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8636
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5661
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4192
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4358
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2765
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1763
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.