Note: If message contains special charcaters like space,@,- etc then please encode the message before passing it into the API call.
<?php
global $message, $mobilenumber,$receivedon;
$mobilenumber = $_REQUEST['mobilenumbe'];
$receivedon=$_REQUEST['receivedon'];
$message = $_REQUEST['message'];
echo $mobilenumber;
echo $message;
?>
<@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1">
try
{
String mobilenumber;
String message;
String receivedon;
mobilenumber =request.getParameter("mobilenumber");
message=request.getParameter("message");
receivedon =request.getParameter("receivedon");
System.out.println(mobilenumber);
System.out.println(message);
System.out.println(receivedon);
}
catch (Exception e)
{
out.println(e);
}
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
public partial class RequestGetInbox : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
String Mobile_Number = null;
String Recivedon = null;
String Message = null;
Mobile_Number = Request.QueryString["mobilenumber"];
Message = Request.QueryString["message"];
Recivedon = Request.QueryString["receivedon"];
Response.Write(Mobile_Number);
Response.Write(Recivedon);
Response.Write(Message);
SqlConnection conn = new SqlConnection("Persist Security Info=False;User ID=xxxxx;Password=XXXX;Initial Catalog=XXXXX;Network Library=dbmssocn;Data Source=xxxxxx;pooling=true;Max Pool Size=199;Min Pool Size=5");
string sql = "insert into Request_Inbox(mobile_number,message,receivedon) values ('" + Mobile_Number + "','" + Message + "','" + Recivedon + "')";
Response.Write(sql);
try
{
conn.Open();
SqlCommand cmd = new SqlCommand(sql, conn);
cmd.ExecuteNonQuery();
}
catch (System.Data.SqlClient.SqlException ex)
{
string msg = "Insert Error:";
msg += ex.Message;
Response.Write(msg);
}
finally
{
conn.Close();
}
}
}
Imports System.Collections
Imports System.Configuration
Imports System.Data
Imports System.Linq
Imports System.Web
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.HtmlControls
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts
Imports System.Xml.Linq
Imports System.Data.SqlClient
Public Partial Class RequestGetInbox
Inherits System.Web.UI.Page
Protected Sub Page_Load(sender As Object, e As EventArgs)
Dim Mobile_Number As [String]
Dim Recivedon As [String]
Dim Message As [String]
Mobile_Number = Request.QueryString("mobilenumber")
Message = Request.QueryString("message")
Recivedon = Request.QueryString("receivedon")
Response.Write(Mobile_Number)
Response.Write(Recivedon)
Response.Write(Message)
Dim conn As New SqlConnection("Persist Security Info=False;User ID=xxx;Password=XXXX;Initial Catalog=XXXXX;Network Library=dbmssocn;Data Source=xxxxx;pooling=true;Max Pool Size=199;Min Pool Size=5")
Dim sql As String = "insert into Request_Inbox(mobile_number,message,receivedon) values ('" & Mobile_Number & "','" & Message & "','" & Recivedon & "')"
Response.Write(sql)
Try
conn.Open()
Dim cmd As New SqlCommand(sql, conn)
cmd.ExecuteNonQuery()
Catch ex As System.Data.SqlClient.SqlException
Dim msg As String = "Insert Error:"
msg += ex.Message
Response.Write(msg)
Finally
conn.Close()
End Try
End Sub
End Class
Facebook Twitter LinkedIn Google Plus