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? -
-
<?php
-
if(isset($_POST['send']))
-
{
-
$member=$_POST['member'];
-
$message=$_POST['message'];
-
mysql_query("insert into send_message(send_to,message) values('".$member."','".$message."')") or die(mysql_error());
-
if($member=="All")
-
{
-
$get_members=mysql_query("select * from member_details" ) or die(mysql_error());
-
$get_members_num=mysql_num_rows($get_members);
-
$i=0;
-
while( $get_members_row=mysql_fetch_array($get_members))
-
{
-
-
if($i==0)
-
{
-
$mobile2=$get_members_row['mobile'];
-
$message="Dear Rtn.".$get_members_row['name'].", ".$_POST['message'];
-
echo $mobile2;
-
-
-
//Change your configurations here.
-
$username="20032757";
-
$password="kqpt4e";
-
$sender="arun";
-
$domain="www.ciainfomedia.com";
-
$method="POST";
-
-
-
-
$username=urlencode($username);
-
$password=urlencode($password);
-
$sender=urlencode($sender);
-
$message=urlencode($message);
-
-
-
-
$url = "http://www.sendindiasms.com/sendurlcomma.asp?user=20032757&pwd=kqpt4e&senderid=ABC&mobileno=$mobile2&msgtext=$message";
-
$ch = curl_init($url);
-
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
-
$curl_scraped_page = curl_exec($ch);
-
curl_close($ch);
-
echo $curl_scraped_page;
-
$i=1;}
-
if($i==1)
-
{
-
$mobile2=$get_members_row['wife_mobile'];
-
$message="Dear Ann.".$get_members_row['wife_name'].", ".$_POST['message'];
-
echo $mobile2;
-
-
-
//Change your configurations here.
-
$username="20032757";
-
$password="kqpt4e";
-
$sender="arun";
-
$domain="www.ciainfomedia.com";
-
$method="POST";
-
-
-
-
$username=urlencode($username);
-
$password=urlencode($password);
-
$sender=urlencode($sender);
-
$message=urlencode($message);
-
-
-
-
$url = "http://www.sendindiasms.com/sendurlcomma.asp?user=20032757&pwd=kqpt4e&senderid=ABC&mobileno=$mobile2&msgtext=$message";
-
$ch = curl_init($url);
-
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
-
$curl_scraped_page = curl_exec($ch);
-
curl_close($ch);
-
echo $curl_scraped_page;
-
$i=0;}
-
}
-
}
-
else if($member=="Members Only")
-
{
-
$get_members=mysql_query("select * from member_details" ) or die(mysql_error());
-
$get_members_num=mysql_num_rows($get_members);
-
while( $get_members_row=mysql_fetch_array($get_members))
-
{
-
-
if($get_members_row['member']=="Husband")
-
{
-
$mobile2=$get_members_row['mobile'];
-
$message="Dear Rtn.".$get_members_row['name'].", ".$_POST['message'];
-
echo $mobile2;
-
-
-
//Change your configurations here.
-
$username="20032757";
-
$password="kqpt4e";
-
$sender="arun";
-
$domain="www.ciainfomedia.com";
-
$method="POST";
-
-
-
-
$username=urlencode($username);
-
$password=urlencode($password);
-
$sender=urlencode($sender);
-
$message=urlencode($message);
-
-
-
-
$url = "http://www.sendindiasms.com/sendurlcomma.asp?user=20032757&pwd=kqpt4e&senderid=ABC&mobileno=$mobile2&msgtext=$message";
-
$ch = curl_init($url);
-
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
-
$curl_scraped_page = curl_exec($ch);
-
curl_close($ch);
-
echo $curl_scraped_page;
-
}
-
else if($get_members_row['member']=="Wife")
-
{
-
$mobile2=$get_members_row['wife_mobile'];
-
$message="Dear Ann.".$get_members_row['wife_name'].", ".$_POST['message'];
-
echo $mobile2;
-
-
-
//Change your configurations here.
-
$username="20032757";
-
$password="kqpt4e";
-
$sender="arun";
-
$domain="www.ciainfomedia.com";
-
$method="POST";
-
-
-
-
$username=urlencode($username);
-
$password=urlencode($password);
-
$sender=urlencode($sender);
-
$message=urlencode($message);
-
-
-
-
$url = "http://www.sendindiasms.com/sendurlcomma.asp?user=20032757&pwd=kqpt4e&senderid=ABC&mobileno=$mobile2&msgtext=$message";
-
$ch = curl_init($url);
-
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
-
$curl_scraped_page = curl_exec($ch);
-
curl_close($ch);
-
echo $curl_scraped_page;
-
}
-
}
-
}
-
else if($member=="Annets")
-
{
-
$get_members=mysql_query("select * from member_details" ) or die(mysql_error());
-
$get_members_num=mysql_num_rows($get_members);
-
while( $get_members_row=mysql_fetch_array($get_members))
-
{
-
-
$mobile2=$get_members_row['wife_mobile'];
-
$message="Dear Ann.".$get_members_row['wife_name'].", ".$_POST['message'];
-
echo $mobile2;
-
-
-
//Change your configurations here.
-
$username="20032757";
-
$password="kqpt4e";
-
$sender="arun";
-
$domain="www.ciainfomedia.com";
-
$method="POST";
-
-
-
-
$username=urlencode($username);
-
$password=urlencode($password);
-
$sender=urlencode($sender);
-
$message=urlencode($message);
-
-
-
-
$url = "http://www.sendindiasms.com/sendurlcomma.asp?user=20032757&pwd=kqpt4e&senderid=ABC&mobileno=$mobile2&msgtext=$message";
-
$ch = curl_init($url);
-
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
-
$curl_scraped_page = curl_exec($ch);
-
curl_close($ch);
-
echo $curl_scraped_page;
-
}
-
}
-
else
-
{
-
$get_members=mysql_query("select * from member_details where name='".$member."' or wife_name='".$member."'") or die(mysql_error());
-
$get_members_num=mysql_num_rows($get_members);
-
while( $get_members_row=mysql_fetch_array($get_members))
-
{
-
if($get_members_row['name']==$member)
-
{
-
$mobile=$get_members_row['mobile'];
-
$message="Dear Rtn.".$member.", ".$_POST['message'];
-
echo $mobile;
-
echo $message;
-
-
//Change your configurations here.
-
$username="20032757";
-
$password="kqpt4e";
-
$sender="arun";
-
$domain="www.ciainfomedia.com";
-
$method="POST";
-
-
-
-
$username=urlencode($username);
-
$password=urlencode($password);
-
$sender=urlencode($sender);
-
$message=urlencode($message);
-
-
-
-
$url = "http://www.sendindiasms.com/sendurlcomma.asp?user=20032757&pwd=kqpt4e&senderid=ABC&mobileno=$mobile&msgtext=$message";
-
$ch = curl_init($url);
-
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
-
$curl_scraped_page = curl_exec($ch);
-
curl_close($ch);
-
echo $curl_scraped_page;}
-
else if($get_members_row['wife_name']==$member)
-
{
-
$mobile=$get_members_row['wife_mobile'];
-
$message="Dear Ann.".$member.", ".$_POST['message'];
-
echo $mobile;
-
-
//Change your configurations here.
-
$username="20032757";
-
$password="kqpt4e";
-
$sender="arun";
-
$domain="www.ciainfomedia.com";
-
$method="POST";
-
-
-
-
$username=urlencode($username);
-
$password=urlencode($password);
-
$sender=urlencode($sender);
-
$message=urlencode($message);
-
-
-
-
$url = "http://www.sendindiasms.com/sendurlcomma.asp?user=20032757&pwd=kqpt4e&senderid=ABC&mobileno=$mobile&msgtext=$message";
-
$ch = curl_init($url);
-
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
-
$curl_scraped_page = curl_exec($ch);
-
curl_close($ch);
-
echo $curl_scraped_page;}
-
}
-
-
}
-
}
-
-
?>
-
-
0 1699 Sign in to post your reply or Sign up for a free account.
Similar topics |
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
'--------------------------------------------------------------------------------------
|
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...
|
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?
|
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:
-------------------------------------------------------------------------------------
|
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) #...
| |
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...
|
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)...
|
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...
|
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
|
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...
|
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...
| |
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,...
|
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,...
|
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...
|
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();...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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
|
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...
| |