acslater
asked on
Sending SMS from server to mobile with JSP
Hey Experts,
I'm trying to send a sms from my website to a user registered in the database.
On my first page (sendsms.jsp) i have a drop down menu that Selects all the Users from the MySQL database. And then a submit button to call the jsp page (smssent.jsp) necessary to perform the sending of the sms message. By the way I'm doing this with clickatell if anyone has used it before. I select one user from this drop down and hence it gets sent to one user.
Not too sure if I should have posted this here or in the other section ... anyway
What I have so far for the smssent.jsp is as follows:
<%
Statement statement = null;
ResultSet resultset = null;
ResultSetMetaData rsmd = null;
Connection connection = null;
Class.forName("org.gjt.mm. mysql.Driv er").newIn stance();
connection = DriverManager.getConnectio n(
"jdbc:mysql://localhost/co mbcdte_pro ject?user= &password= ");
statement = connection.createStatement ();
ResultSet rs = statement.executeQuery("SE LECT * FROM Member WHERE UserName= method="post" action="http://api.clickatell.com/http/sendmsg?user=&password=&api_id=&to=&text=Meet+me+outside");
user = "";
password = "";
api_id = "";
baseurl ="http://api.clickatell.com";
text = urlencode("Hi from ...");
to = Phone;
<p align="center"> </p>
<p align="center">
<%
{
connection.close();
}
%>
Problem is sending it. What my intention is to select the User's phone no. from the database that equals to the member selected from the drop down menu. And to have a pre defined messsage like, "Hi bla bla bla". I probably need to have variables in there for some of the values?
I'm trying to send a sms from my website to a user registered in the database.
On my first page (sendsms.jsp) i have a drop down menu that Selects all the Users from the MySQL database. And then a submit button to call the jsp page (smssent.jsp) necessary to perform the sending of the sms message. By the way I'm doing this with clickatell if anyone has used it before. I select one user from this drop down and hence it gets sent to one user.
Not too sure if I should have posted this here or in the other section ... anyway
What I have so far for the smssent.jsp is as follows:
<%
Statement statement = null;
ResultSet resultset = null;
ResultSetMetaData rsmd = null;
Connection connection = null;
Class.forName("org.gjt.mm.
connection = DriverManager.getConnectio
"jdbc:mysql://localhost/co
statement = connection.createStatement
ResultSet rs = statement.executeQuery("SE
user = "";
password = "";
api_id = "";
baseurl ="http://api.clickatell.com";
text = urlencode("Hi from ...");
to = Phone;
<p align="center"> </p>
<p align="center">
<%
{
connection.close();
}
%>
Problem is sending it. What my intention is to select the User's phone no. from the database that equals to the member selected from the drop down menu. And to have a pre defined messsage like, "Hi bla bla bla". I probably need to have variables in there for some of the values?
ASKER
ok changed to the above and am getting 18 errors now.
the last part says:
Note: /home/combcdte/tomcat/work /smssent_j sp.java uses or overrides a deprecated API.
Note: Recompile with -deprecation for details.
18 errors
all the errors say >> cannot resolve symbol
the last part says:
Note: /home/combcdte/tomcat/work
Note: Recompile with -deprecation for details.
18 errors
all the errors say >> cannot resolve symbol
set up an account with vgsmail.com and they will give u bout 11 free texts before you have to pay them, but its enough for testing.
The sms interface has the URL http://www.vgsmail.com/cgi/sendsms.cgi and requires the following parameters (either as GET or POST methods):
userid ---- Your vgsmail userid
password ---- Your vgsmail password
to ---- The destination number
from ---- The originator ID of the message (must be enabled on your account)
text ---- The text you wish to send
So, using the GET method in the address bar when u get ur user id and password just but them in this below and the number and it should work,
http://www.vgsmail.com/cgi/sendsms.cgi?userid=MYUSERID&password=MYPASSWORD&to=353879248633&text=this+is+a+test
The sms interface has the URL http://www.vgsmail.com/cgi/sendsms.cgi and requires the following parameters (either as GET or POST methods):
userid ---- Your vgsmail userid
password ---- Your vgsmail password
to ---- The destination number
from ---- The originator ID of the message (must be enabled on your account)
text ---- The text you wish to send
So, using the GET method in the address bar when u get ur user id and password just but them in this below and the number and it should work,
http://www.vgsmail.com/cgi/sendsms.cgi?userid=MYUSERID&password=MYPASSWORD&to=353879248633&text=this+is+a+test
ASKER
I've set up an account with clickatell, its the same as the rest. I can post a message in the url so thats working fine so not much point in joining up with someone else aswell. I'm just trying to integrate it so that i can send a message to a user in the database by clicking a button ...
okay u will get can not resolve errors because none of our variables are declared.
<%
Statement statement = null;
ResultSet resultset = null;
ResultSetMetaData rsmd = null;
Connection connection = null;
Class.forName("org.gjt.mm. mysql.Driv er").newIn stance();
connection = DriverManager.getConnectio n(
"jdbc:mysql://localhost/co mbcdte_pro ject?user= &password= ");
statement = connection.createStatement ();
ResultSet rs = statement.executeQuery("SE LECT * FROM Member WHERE UserName="+request.getPara meter("Use r"));
String user = "";
String password = "";
String api_id = "";
String baseurl ="http://api.clickatell.com";
String text = urlencode("Hi from ...");
String to = Phone;
if(rs.next())
{
user =rs.getString("user");
password = rs.getString("password");
api_id = "";
baseurl ="http://api.clickatell.com";
text = urlencode("Hi from ...");
to =rs.getString("phone");
}
%>
<html>
<body onload=document.forms[0].s ubmit();>
<form method="post" action="http://api.clickatell.com/http/sendmsg?user=<%=user%>&password =<%=passwo rd%>&api_i d=&to=<%=t o%>&text=M eet+me+out side">
</form>
<p align="center"> </p>
<p align="center"> </p>
</body>
</html>
<%
{
connection.close();
}
%>
<%
Statement statement = null;
ResultSet resultset = null;
ResultSetMetaData rsmd = null;
Connection connection = null;
Class.forName("org.gjt.mm.
connection = DriverManager.getConnectio
"jdbc:mysql://localhost/co
statement = connection.createStatement
ResultSet rs = statement.executeQuery("SE
String user = "";
String password = "";
String api_id = "";
String baseurl ="http://api.clickatell.com";
String text = urlencode("Hi from ...");
String to = Phone;
if(rs.next())
{
user =rs.getString("user");
password = rs.getString("password");
api_id = "";
baseurl ="http://api.clickatell.com";
text = urlencode("Hi from ...");
to =rs.getString("phone");
}
%>
<html>
<body onload=document.forms[0].s
<form method="post" action="http://api.clickatell.com/http/sendmsg?user=<%=user%>&password
</form>
<p align="center"> </p>
<p align="center"> </p>
</body>
</html>
<%
{
connection.close();
}
%>
ASKER
I've declared all the strings and values in ...
String user = "";
String password = "";
String api_id = "";
String baseurl ="http://api.clickatell.com";
String text = urlencode("Hi from ...");
String to = Phone;
"Phone" is the attribute in the db, and should be ok.
Does the form below look correct? Still getting errors for this.
<form method="post" action="http://api.clickatell.com/http/sendmsg?user=<%=user%>&password =<%=passwo rd%>&api_i d=<%api_id %>&to=<%to %>&text=<% text%>">
String user = "";
String password = "";
String api_id = "";
String baseurl ="http://api.clickatell.com";
String text = urlencode("Hi from ...");
String to = Phone;
"Phone" is the attribute in the db, and should be ok.
Does the form below look correct? Still getting errors for this.
<form method="post" action="http://api.clickatell.com/http/sendmsg?user=<%=user%>&password
you are missing some = signs in the form..
<form method="post" action="http://api.clickatell.com/http/sendmsg?user=<%=user%>&password =<%=passwo rd%>&api_i d=<%api_id %>&to=<%to %>&text=<% text%>">
shd be
<form method="post" action="http://api.clickatell.com/http/sendmsg?user=<%=user%>&password =<%=passwo rd%>&api_i d=<%=api_i d%>&to=<%= to%>&text= <%=text%>" >
<form method="post" action="http://api.clickatell.com/http/sendmsg?user=<%=user%>&password
shd be
<form method="post" action="http://api.clickatell.com/http/sendmsg?user=<%=user%>&password
ASKER
ok I changed that bit and now saying ..
org.apache.jasper.JasperEx ception: Unable to compile class for JSP
.......
.......
.......
root cause
java.lang.ClassNotFoundExc eption: org.apache.jsp.smssent_jsp
org.apache.jasper.JasperEx
.......
.......
.......
root cause
java.lang.ClassNotFoundExc
whats the full error trace??
It looks like its not finding some class that needs to be there....
It looks like its not finding some class that needs to be there....
ASKER
The full error trace is ...
type Exception report
message Internal Server Error
description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperEx ception: Unable to compile class for JSP
at org.apache.jasper.JspCompi lationCont ext.load(J spCompilat ionContext .java:500)
at org.apache.jasper.servlet. JspServlet Wrapper.ge tServlet(J spServletW rapper.jav a:150)
at org.apache.jasper.servlet. JspServlet Wrapper.se rvice(JspS ervletWrap per.java:1 95)
at org.apache.jasper.servlet. JspServlet .serviceJs pFile(JspS ervlet.jav a:295)
at org.apache.jasper.servlet. JspServlet .service(J spServlet. java:241)
at javax.servlet.http.HttpSer vlet.servi ce(HttpSer vlet.java: 853)
at org.apache.catalina.core.A pplication FilterChai n.internal DoFilter(A pplication FilterChai n.java:247 )
at org.apache.catalina.core.A pplication FilterChai n.doFilter (Applicati onFilterCh ain.java:1 93)
at org.apache.catalina.core.S tandardWra pperValve. invoke(Sta ndardWrapp erValve.ja va:256)
at org.apache.catalina.core.S tandardPip eline$Stan dardPipeli neValveCon text.invok eNext(Stan dardPipeli ne.java:64 3)
at org.apache.catalina.core.S tandardPip eline.invo ke(Standar dPipeline. java:480)
at org.apache.catalina.core.C ontainerBa se.invoke( ContainerB ase.java:9 95)
at org.apache.catalina.core.S tandardCon textValve. invoke(Sta ndardConte xtValve.ja va:191)
at org.apache.catalina.core.S tandardPip eline$Stan dardPipeli neValveCon text.invok eNext(Stan dardPipeli ne.java:64 3)
at org.apache.catalina.core.S tandardPip eline.invo ke(Standar dPipeline. java:480)
at org.apache.catalina.core.C ontainerBa se.invoke( ContainerB ase.java:9 95)
at org.apache.catalina.core.S tandardCon text.invok e(Standard Context.ja va:2422)
at org.apache.catalina.core.S tandardHos tValve.inv oke(Standa rdHostValv e.java:180 )
at org.apache.catalina.core.S tandardPip eline$Stan dardPipeli neValveCon text.invok eNext(Stan dardPipeli ne.java:64 3)
at org.apache.catalina.valves .ErrorDisp atcherValv e.invoke(E rrorDispat cherValve. java:171)
at org.apache.catalina.core.S tandardPip eline$Stan dardPipeli neValveCon text.invok eNext(Stan dardPipeli ne.java:64 1)
at org.apache.catalina.valves .ErrorRepo rtValve.in voke(Error ReportValv e.java:163 )
at org.apache.catalina.core.S tandardPip eline$Stan dardPipeli neValveCon text.invok eNext(Stan dardPipeli ne.java:64 1)
at org.apache.catalina.core.S tandardPip eline.invo ke(Standar dPipeline. java:480)
at org.apache.catalina.core.C ontainerBa se.invoke( ContainerB ase.java:9 95)
at org.apache.catalina.core.S tandardEng ineValve.i nvoke(Stan dardEngine Valve.java :174)
at org.apache.catalina.core.S tandardPip eline$Stan dardPipeli neValveCon text.invok eNext(Stan dardPipeli ne.java:64 3)
at org.apache.catalina.core.S tandardPip eline.invo ke(Standar dPipeline. java:480)
at org.apache.catalina.core.C ontainerBa se.invoke( ContainerB ase.java:9 95)
at org.apache.ajp.tomcat4.Ajp 13Processo r.process( Ajp13Proce ssor.java: 457)
at org.apache.ajp.tomcat4.Ajp 13Processo r.run(Ajp1 3Processor .java:576)
at java.lang.Thread.run(Threa d.java:534 )
root cause
java.lang.ClassNotFoundExc eption: org.apache.jsp.smssent_jsp
at org.apache.jasper.servlet. JasperLoad er.loadCla ss(JasperL oader.java :209)
at org.apache.jasper.servlet. JasperLoad er.loadCla ss(JasperL oader.java :131)
at org.apache.jasper.JspCompi lationCont ext.load(J spCompilat ionContext .java:497)
at org.apache.jasper.servlet. JspServlet Wrapper.ge tServlet(J spServletW rapper.jav a:150)
at org.apache.jasper.servlet. JspServlet Wrapper.se rvice(JspS ervletWrap per.java:1 95)
at org.apache.jasper.servlet. JspServlet .serviceJs pFile(JspS ervlet.jav a:295)
at org.apache.jasper.servlet. JspServlet .service(J spServlet. java:241)
at javax.servlet.http.HttpSer vlet.servi ce(HttpSer vlet.java: 853)
at org.apache.catalina.core.A pplication FilterChai n.internal DoFilter(A pplication FilterChai n.java:247 )
at org.apache.catalina.core.A pplication FilterChai n.doFilter (Applicati onFilterCh ain.java:1 93)
at org.apache.catalina.core.S tandardWra pperValve. invoke(Sta ndardWrapp erValve.ja va:256)
at org.apache.catalina.core.S tandardPip eline$Stan dardPipeli neValveCon text.invok eNext(Stan dardPipeli ne.java:64 3)
at org.apache.catalina.core.S tandardPip eline.invo ke(Standar dPipeline. java:480)
at org.apache.catalina.core.C ontainerBa se.invoke( ContainerB ase.java:9 95)
at org.apache.catalina.core.S tandardCon textValve. invoke(Sta ndardConte xtValve.ja va:191)
at org.apache.catalina.core.S tandardPip eline$Stan dardPipeli neValveCon text.invok eNext(Stan dardPipeli ne.java:64 3)
at org.apache.catalina.core.S tandardPip eline.invo ke(Standar dPipeline. java:480)
at org.apache.catalina.core.C ontainerBa se.invoke( ContainerB ase.java:9 95)
at org.apache.catalina.core.S tandardCon text.invok e(Standard Context.ja va:2422)
at org.apache.catalina.core.S tandardHos tValve.inv oke(Standa rdHostValv e.java:180 )
at org.apache.catalina.core.S tandardPip eline$Stan dardPipeli neValveCon text.invok eNext(Stan dardPipeli ne.java:64 3)
at org.apache.catalina.valves .ErrorDisp atcherValv e.invoke(E rrorDispat cherValve. java:171)
at org.apache.catalina.core.S tandardPip eline$Stan dardPipeli neValveCon text.invok eNext(Stan dardPipeli ne.java:64 1)
at org.apache.catalina.valves .ErrorRepo rtValve.in voke(Error ReportValv e.java:163 )
at org.apache.catalina.core.S tandardPip eline$Stan dardPipeli neValveCon text.invok eNext(Stan dardPipeli ne.java:64 1)
at org.apache.catalina.core.S tandardPip eline.invo ke(Standar dPipeline. java:480)
at org.apache.catalina.core.C ontainerBa se.invoke( ContainerB ase.java:9 95)
at org.apache.catalina.core.S tandardEng ineValve.i nvoke(Stan dardEngine Valve.java :174)
at org.apache.catalina.core.S tandardPip eline$Stan dardPipeli neValveCon text.invok eNext(Stan dardPipeli ne.java:64 3)
at org.apache.catalina.core.S tandardPip eline.invo ke(Standar dPipeline. java:480)
at org.apache.catalina.core.C ontainerBa se.invoke( ContainerB ase.java:9 95)
at org.apache.ajp.tomcat4.Ajp 13Processo r.process( Ajp13Proce ssor.java: 457)
at org.apache.ajp.tomcat4.Ajp 13Processo r.run(Ajp1 3Processor .java:576)
at java.lang.Thread.run(Threa d.java:534 )
type Exception report
message Internal Server Error
description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperEx
at org.apache.jasper.JspCompi
at org.apache.jasper.servlet.
at org.apache.jasper.servlet.
at org.apache.jasper.servlet.
at org.apache.jasper.servlet.
at javax.servlet.http.HttpSer
at org.apache.catalina.core.A
at org.apache.catalina.core.A
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.core.C
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.core.C
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.valves
at org.apache.catalina.core.S
at org.apache.catalina.valves
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.core.C
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.core.C
at org.apache.ajp.tomcat4.Ajp
at org.apache.ajp.tomcat4.Ajp
at java.lang.Thread.run(Threa
root cause
java.lang.ClassNotFoundExc
at org.apache.jasper.servlet.
at org.apache.jasper.servlet.
at org.apache.jasper.JspCompi
at org.apache.jasper.servlet.
at org.apache.jasper.servlet.
at org.apache.jasper.servlet.
at org.apache.jasper.servlet.
at javax.servlet.http.HttpSer
at org.apache.catalina.core.A
at org.apache.catalina.core.A
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.core.C
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.core.C
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.valves
at org.apache.catalina.core.S
at org.apache.catalina.valves
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.core.C
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.core.C
at org.apache.ajp.tomcat4.Ajp
at org.apache.ajp.tomcat4.Ajp
at java.lang.Thread.run(Threa
whats the name of your jsp file? it should be smssent.jsp ( all lower cases)...
ASKER
i changed it / renamed it because it wasn't registering properly.
I'm getting 3 errors now ...
org.apache.jasper.JasperEx ception: Unable to compile class for JSP
An error occurred at line: 93 in the jsp file: /sent.jsp
Generated servlet error:
[javac] Compiling 1 source file
/home/combcdte/tomcat/work /sent_jsp. java:174: cannot resolve symbol
symbol : method urlencode (java.lang.String)
location: class org.apache.jsp.sent_jsp
String text = urlencode("Hi from ...");
^
An error occurred at line: 93 in the jsp file: /sent.jsp
Generated servlet error:
/home/combcdte/tomcat/work /sent_jsp. java:175: cannot resolve symbol
symbol : variable Phone
location: class org.apache.jsp.sent_jsp
String to = Phone;
^
An error occurred at line: 93 in the jsp file: /sent.jsp
Generated servlet error:
/home/combcdte/tomcat/work /sent_jsp. java:182: cannot resolve symbol
symbol : method urlencode (java.lang.String)
location: class org.apache.jsp.sent_jsp
text = urlencode("Hi from ...");
^
Note: /home/combcdte/tomcat/work /sent_jsp. java uses or overrides a deprecated API.
Note: Recompile with -deprecation for details.
3 errors
I'm getting 3 errors now ...
org.apache.jasper.JasperEx
An error occurred at line: 93 in the jsp file: /sent.jsp
Generated servlet error:
[javac] Compiling 1 source file
/home/combcdte/tomcat/work
symbol : method urlencode (java.lang.String)
location: class org.apache.jsp.sent_jsp
String text = urlencode("Hi from ...");
^
An error occurred at line: 93 in the jsp file: /sent.jsp
Generated servlet error:
/home/combcdte/tomcat/work
symbol : variable Phone
location: class org.apache.jsp.sent_jsp
String to = Phone;
^
An error occurred at line: 93 in the jsp file: /sent.jsp
Generated servlet error:
/home/combcdte/tomcat/work
symbol : method urlencode (java.lang.String)
location: class org.apache.jsp.sent_jsp
text = urlencode("Hi from ...");
^
Note: /home/combcdte/tomcat/work
Note: Recompile with -deprecation for details.
3 errors
urlencode is not a method so you can not use it as is...
<%
Statement statement = null;
ResultSet resultset = null;
ResultSetMetaData rsmd = null;
Connection connection = null;
Class.forName("org.gjt.mm. mysql.Driv er").newIn stance();
connection = DriverManager.getConnectio n(
"jdbc:mysql://localhost/co mbcdte_pro ject?user= &password= ");
statement = connection.createStatement ();
ResultSet rs = statement.executeQuery("SE LECT * FROM Member WHERE UserName="+request.getPara meter("Use r"));
String user = "";
String password = "";
String api_id = "";
String baseurl ="http://api.clickatell.com";
String text = "Hi from ...";
String to = "";
if(rs.next())
{
user =rs.getString("user");
password = rs.getString("password");
api_id = "";
baseurl ="http://api.clickatell.com";
text = "Hi from ...";
to =rs.getString("phone");
}
%>
<html>
<body onload=document.forms[0].s ubmit();>
<form method="post" action="http://api.clickatell.com/http/sendmsg?user=<%=user%>&password =<%=passwo rd%>&api_i d=&to=<%=t o%>&text=M eet+me+out side">
</form>
<p align="center"> </p>
<p align="center"> </p>
</body>
</html>
<%
{
connection.close();
}
%>
This jsp shd atleast compile...
<%
Statement statement = null;
ResultSet resultset = null;
ResultSetMetaData rsmd = null;
Connection connection = null;
Class.forName("org.gjt.mm.
connection = DriverManager.getConnectio
"jdbc:mysql://localhost/co
statement = connection.createStatement
ResultSet rs = statement.executeQuery("SE
String user = "";
String password = "";
String api_id = "";
String baseurl ="http://api.clickatell.com";
String text = "Hi from ...";
String to = "";
if(rs.next())
{
user =rs.getString("user");
password = rs.getString("password");
api_id = "";
baseurl ="http://api.clickatell.com";
text = "Hi from ...";
to =rs.getString("phone");
}
%>
<html>
<body onload=document.forms[0].s
<form method="post" action="http://api.clickatell.com/http/sendmsg?user=<%=user%>&password
</form>
<p align="center"> </p>
<p align="center"> </p>
</body>
</html>
<%
{
connection.close();
}
%>
This jsp shd atleast compile...
ASKER
ok this is what I have now ... The first part is what I have from the page i am sending from, ie the drop down table:
//connection ....
ResultSet rs = statement.executeQuery("SE LECT UserName FROM Member");
String name = null;
ArrayList list = new ArrayList();
while ( rs.next() ) {
name=rs.getString("UserNam e");
list.add(name);
}
%>
<%
{
connection.close();
}
%>
</p>
<p>
Send SMS to:  
<select>
<%
if(list != null)
{
for(int i =0; i < list.size(); i++)
{
String value = (String) list.get(i);
%>
<option value="<%=value%>"><%=valu e%></optio n>
<%}
}
else
{%>
<option value=dummy>None</option>
<%}%>
</select>
<p>
<form name="frm1" id="frm1" method="post" action="sent.jsp" onSubmit="return validateForm(frm1)">
<input type="submit" name="Submit3" value="Send">
<p></form> </p>
//This is the page that it is going to / requesting called sent.jsp
<%
out.print("Administrator logged in: " + session.getValue("UserName ")+ "<br>");
%>
</p>
<p>
<%
Statement statement = null;
ResultSet resultset = null;
ResultSetMetaData rsmd = null;
Connection connection = null;
Class.forName("org.gjt.mm. mysql.Driv er").newIn stance();
connection = DriverManager.getConnectio n(
"jdbc:mysql://localhost/co mbcdte_pro ject?user= &password= ");
statement = connection.createStatement ();
String name = "'" + request.getParameter("name ") + "'";
ResultSet rs = statement.executeQuery("SE LECT * FROM Member WHERE UserName="+request.getPara meter("nam e"));
String user = "//user";
String password = "//password";
String api_id = "//api-id";
String baseurl ="http://api.clickatell.com";
String text = "Hi from ...";
String to = "Phone";
if(rs.next())
{
user = "user";
password = "password";
api_id = "api_id";
baseurl ="http://api.clickatell.com";
text = "Hi from ...";
to =rs.getString("Phone");
}
%>
<html>
<body onload=document.forms[0].s ubmit();>
<form method="post" action="http://api.clickatell.com/http/sendmsg?user=<%=user%>&password =<%=passwo rd%>&api_i d=<%=api_i d%>&to=<%= to%>&text= <%=text%>" >
</form>
<p align="center"> </p>
<p align="center"> </p>
</body>
</html>
<%
{
connection.close();
}
%>
//Now I actually have it requesting the page and displaying it without any errors
But it is not sending the message. Is it because Phone is not set properly, or the wrong "name" / "username" is selected or anything else you could come up with?
//connection ....
ResultSet rs = statement.executeQuery("SE
String name = null;
ArrayList list = new ArrayList();
while ( rs.next() ) {
name=rs.getString("UserNam
list.add(name);
}
%>
<%
{
connection.close();
}
%>
</p>
<p>
Send SMS to:  
<select>
<%
if(list != null)
{
for(int i =0; i < list.size(); i++)
{
String value = (String) list.get(i);
%>
<option value="<%=value%>"><%=valu
<%}
}
else
{%>
<option value=dummy>None</option>
<%}%>
</select>
<p>
<form name="frm1" id="frm1" method="post" action="sent.jsp" onSubmit="return validateForm(frm1)">
<input type="submit" name="Submit3" value="Send">
<p></form> </p>
//This is the page that it is going to / requesting called sent.jsp
<%
out.print("Administrator logged in: " + session.getValue("UserName
%>
</p>
<p>
<%
Statement statement = null;
ResultSet resultset = null;
ResultSetMetaData rsmd = null;
Connection connection = null;
Class.forName("org.gjt.mm.
connection = DriverManager.getConnectio
"jdbc:mysql://localhost/co
statement = connection.createStatement
String name = "'" + request.getParameter("name
ResultSet rs = statement.executeQuery("SE
String user = "//user";
String password = "//password";
String api_id = "//api-id";
String baseurl ="http://api.clickatell.com";
String text = "Hi from ...";
String to = "Phone";
if(rs.next())
{
user = "user";
password = "password";
api_id = "api_id";
baseurl ="http://api.clickatell.com";
text = "Hi from ...";
to =rs.getString("Phone");
}
%>
<html>
<body onload=document.forms[0].s
<form method="post" action="http://api.clickatell.com/http/sendmsg?user=<%=user%>&password
</form>
<p align="center"> </p>
<p align="center"> </p>
</body>
</html>
<%
{
connection.close();
}
%>
//Now I actually have it requesting the page and displaying it without any errors
But it is not sending the message. Is it because Phone is not set properly, or the wrong "name" / "username" is selected or anything else you could come up with?
any of your above mentioned stuff can throw the SMS sending away... best way is to do a right click on the page and see if the parameters are the way you want them to be in the form url...
second way of testing it wd be taking the url from the form ( one that shows up in the view source of your HTML).
paste it in a browser and see if it sends the SMS for you.....
second way of testing it wd be taking the url from the form ( one that shows up in the view source of your HTML).
paste it in a browser and see if it sends the SMS for you.....
ASKER
ok ive tried that, whats being posted is the following
http://api.clickatell.com/http/sendmsg?user=xxx&password=xxx&api_id=xxx&to=Phone&text=Hi from ...
and the result is ...
ERR: 105, Invalid Destination Address
So i'm guessing its not being pulled properly from the database? Would I need to specify in the select statement "Phone" aswell ...
http://api.clickatell.com/http/sendmsg?user=xxx&password=xxx&api_id=xxx&to=Phone&text=Hi from ...
and the result is ...
ERR: 105, Invalid Destination Address
So i'm guessing its not being pulled properly from the database? Would I need to specify in the select statement "Phone" aswell ...
ResultSet rs = statement.executeQuery("SE LECT * FROM Member WHERE UserName="+request.getPara meter("nam e"));
Most probably this statement is not fetching any row form the database..
here I am assuming that you have got a field named"phone" in your database, because that what we are trying to get from this select query.. Also if the username is of type string ( which most probably it is).. then you will have to write it in following manner..
ResultSet rs = statement.executeQuery("SE LECT * FROM Member WHERE UserName='"+request.getPar ameter("na me")+"'");
i.e. put single quotes around the value... then only it will match.. ( I hate SQL for that)....
Most probably this statement is not fetching any row form the database..
here I am assuming that you have got a field named"phone" in your database, because that what we are trying to get from this select query.. Also if the username is of type string ( which most probably it is).. then you will have to write it in following manner..
ResultSet rs = statement.executeQuery("SE
i.e. put single quotes around the value... then only it will match.. ( I hate SQL for that)....
ASKER
Ok i tried changing that around but no luck, its still not passing through the Phone no.
Yes there is a field called Phone in the table Member. Would this be because I need to request it after the Select statement ...
"+request.getParameter("Ph one")+" ??
Yes there is a field called Phone in the table Member. Would this be because I need to request it after the Select statement ...
"+request.getParameter("Ph
your phone parameter is coming from request or its coming from database??
if its coming from database then
if(rs.next())
{
user = "user";
password = "password";
api_id = "api_id";
baseurl ="http://api.clickatell.com";
text = "Hi from ...";
to =rs.getString("Phone");
}
this piece shd be assigning it to the to field..
if its coming from the request then we need to go a request.getParameter("Phon e");
post your current jsp and also tell me what all fields are being provided to this jsp so that we can look in to it...
if its coming from database then
if(rs.next())
{
user = "user";
password = "password";
api_id = "api_id";
baseurl ="http://api.clickatell.com";
text = "Hi from ...";
to =rs.getString("Phone");
}
this piece shd be assigning it to the to field..
if its coming from the request then we need to go a request.getParameter("Phon
post your current jsp and also tell me what all fields are being provided to this jsp so that we can look in to it...
ASKER
Ok that what I had. Theres no errors when i do it, but message is not sent. If I replace
>> to =rs.getString("Phone");
with
>>to =rs.getString("3538xxxxxxx x");
The message is still not sent, but no errors. But if I view the souce of that page and post the method in the URL it WILL send the message to that number. The Phone number is coming from the database, when a User is selected from the drop down menu, so rs.getString("Phone"); should be used? The following is the code I have.
<%
out.print("Administrator logged in: " + session.getValue("UserName ")+ "<br>");
%>
</p>
<p>
<%
Statement statement = null;
ResultSet resultset = null;
ResultSetMetaData rsmd = null;
Connection connection = null;
Class.forName("org.gjt.mm. mysql.Driv er").newIn stance();
connection = DriverManager.getConnectio n(
"jdbc:mysql://localhost/co mbcdte_pro ject?user= combcdte_a dmin&passw ord=*sonyt 630*");
statement = connection.createStatement ();
String name = "'" + request.getParameter("name ") + "'";
ResultSet rs = statement.executeQuery("SE LECT * FROM Member WHERE UserName="+request.getPara meter("nam e"));
/*
ResultSet rs = statement.executeQuery("SE LECT * FROM Member WHERE UserName='"+request.getPar ameter("Us erName")+" '");
*/
String user = "xxx";
String password = "xxx";
String api_id = "xxx";
String baseurl ="http://api.clickatell.com";
String text = "Hi from ...";
String to = "Phone";
if(rs.next())
{
user = "user";
password = "password";
api_id = "api_id";
baseurl ="http://api.clickatell.com";
text = "Hi from ...";
to =rs.getString("Phone");
}
%>
<html>
<body onload=document.forms[0].s ubmit();>
<form method="post" action="http://api.clickatell.com/http/sendmsg?user=<%=user%>&password =<%=passwo rd%>&api_i d=<%=api_i d%>&to=<%= to%>&text= <%=text%>" >
</form>
<p align="center"> </p>
<p align="center"> </p>
</body>
</html>
<%
{
connection.close();
}
%>
>> to =rs.getString("Phone");
with
>>to =rs.getString("3538xxxxxxx
The message is still not sent, but no errors. But if I view the souce of that page and post the method in the URL it WILL send the message to that number. The Phone number is coming from the database, when a User is selected from the drop down menu, so rs.getString("Phone"); should be used? The following is the code I have.
<%
out.print("Administrator logged in: " + session.getValue("UserName
%>
</p>
<p>
<%
Statement statement = null;
ResultSet resultset = null;
ResultSetMetaData rsmd = null;
Connection connection = null;
Class.forName("org.gjt.mm.
connection = DriverManager.getConnectio
"jdbc:mysql://localhost/co
statement = connection.createStatement
String name = "'" + request.getParameter("name
ResultSet rs = statement.executeQuery("SE
/*
ResultSet rs = statement.executeQuery("SE
*/
String user = "xxx";
String password = "xxx";
String api_id = "xxx";
String baseurl ="http://api.clickatell.com";
String text = "Hi from ...";
String to = "Phone";
if(rs.next())
{
user = "user";
password = "password";
api_id = "api_id";
baseurl ="http://api.clickatell.com";
text = "Hi from ...";
to =rs.getString("Phone");
}
%>
<html>
<body onload=document.forms[0].s
<form method="post" action="http://api.clickatell.com/http/sendmsg?user=<%=user%>&password
</form>
<p align="center"> </p>
<p align="center"> </p>
</body>
</html>
<%
{
connection.close();
}
%>
okay lets do these two things in your jsp..
<%
out.print("Administrator logged in: " + session.getValue("UserName ")+ "<br>");
%>
</p>
<p>
<%
Statement statement = null;
ResultSet resultset = null;
ResultSetMetaData rsmd = null;
Connection connection = null;
Class.forName("org.gjt.mm. mysql.Driv er").newIn stance();
connection = DriverManager.getConnectio n(
"jdbc:mysql://localhost/co mbcdte_pro ject?user= combcdte_a dmin&passw ord=*sonyt 630*");
statement = connection.createStatement ();
String name = "'" + request.getParameter("name ") + "'";
System.out.println("user is : -->"+name); // to check if we are getting the user name correctly
ResultSet rs = statement.executeQuery("SE LECT * FROM Member WHERE UserName="+request.getPara meter("nam e"));
/*
ResultSet rs = statement.executeQuery("SE LECT * FROM Member WHERE UserName='"+request.getPar ameter("Us erName")+" '");
*/
String user = "xxx";
String password = "xxx";
String api_id = "xxx";
String baseurl ="http://api.clickatell.com";
String text = "Hi from ...";
String to = "Phone"; //if this does not work then change the phone number to some hardcoded number for testing
if(rs.next())
{
user = "user";
password = "password";
api_id = "api_id";
baseurl ="http://api.clickatell.com";
text = "Hi from ...";
to =rs.getString("Phone");
}
%>
<html>
<body>
<frame src="http://api.clickatell.com/http/sendmsg?user=<%=user%>&password=<% =password% >&api_id=< %=api_id%> &to=<%=to% >&text=<%= text%>"></ frame>
<p align="center"> </p>
<p align="center"> </p>
</body>
</html>
<%
{
connection.close();
}
%>
try this and let me know what it prints at the console for user name... and if its the correct user name as per the database...
<%
out.print("Administrator logged in: " + session.getValue("UserName
%>
</p>
<p>
<%
Statement statement = null;
ResultSet resultset = null;
ResultSetMetaData rsmd = null;
Connection connection = null;
Class.forName("org.gjt.mm.
connection = DriverManager.getConnectio
"jdbc:mysql://localhost/co
statement = connection.createStatement
String name = "'" + request.getParameter("name
System.out.println("user is : -->"+name); // to check if we are getting the user name correctly
ResultSet rs = statement.executeQuery("SE
/*
ResultSet rs = statement.executeQuery("SE
*/
String user = "xxx";
String password = "xxx";
String api_id = "xxx";
String baseurl ="http://api.clickatell.com";
String text = "Hi from ...";
String to = "Phone"; //if this does not work then change the phone number to some hardcoded number for testing
if(rs.next())
{
user = "user";
password = "password";
api_id = "api_id";
baseurl ="http://api.clickatell.com";
text = "Hi from ...";
to =rs.getString("Phone");
}
%>
<html>
<body>
<frame src="http://api.clickatell.com/http/sendmsg?user=<%=user%>&password=<%
<p align="center"> </p>
<p align="center"> </p>
</body>
</html>
<%
{
connection.close();
}
%>
try this and let me know what it prints at the console for user name... and if its the correct user name as per the database...
I think your problem is simply the phone number you are sending to. It has to be in the format +35387.... Change this and then try sending it through the url to test it. When that works concentrate on how you send it from the jsp page.
ASKER
Raftor
>>The message is still not sent, but no errors. But if I view the souce of that page and post the method in the URL it WILL send the message to that number
>>The message is still not sent, but no errors. But if I view the souce of that page and post the method in the URL it WILL send the message to that number
ASKER
I've tried your above help.
I added in the necessary.
When i submit, the result from
>>out.println("user is : -->"+name); // to check if we are getting the user name correctly
is user is : -->'null'
I added in the necessary.
When i submit, the result from
>>out.println("user is : -->"+name); // to check if we are getting the user name correctly
is user is : -->'null'
yup! that means its not getting the user name that you are hoping that it will get!..
since the user name is not correct, your query is not returning anything and hence we do not have the phone number...
how you are passing the user name to this page?
post the code of that page where user selects some user name and you post the data to this jsp... then I shd be able to find out the problem
since the user name is not correct, your query is not returning anything and hence we do not have the phone number...
how you are passing the user name to this page?
post the code of that page where user selects some user name and you post the data to this jsp... then I shd be able to find out the problem
ASKER
I'm using
+request.getParameter("nam e"));
//Where the user selects a user from the db ....
ResultSet rs = statement.executeQuery("SE LECT UserName FROM Member");
String name = null;
ArrayList list = new ArrayList();
while ( rs.next() ) {
name=rs.getString("UserNam e");
list.add(name);
}
%>
<%
{
connection.close();
}
%>
</p>
<p>
Send SMS to:  
<select>
<%
if(list != null)
{
for(int i =0; i < list.size(); i++)
{
String value = (String) list.get(i);
%>
<option value="<%=value%>"><%=valu e%></optio n>
<%}
}
else
{%>
<option value=dummy>None</option>
<%}%>
</select>
<p>
<form name="frm1" id="frm1" method="post" action="sent.jsp" onSubmit="return validateForm(frm1)">
<input type="submit" name="Submit3" value="Send">
<p></form> </p>
// The jsp ...
String name = "'" + request.getParameter("name ") + "'";
out.println("user is : -->"+name); // to check if we are getting the user name correctly
ResultSet rs = statement.executeQuery("SE LECT * FROM Member WHERE UserName="+request.getPara meter("nam e"));
/*
ResultSet rs = statement.executeQuery("SE LECT * FROM Member WHERE UserName='"+request.getPar ameter("na me")+"'");
*/
String user = "xxx";
String password = "xxx";
String api_id = "xxx";
String baseurl ="http://api.clickatell.com";
String text = "Hi from ...";
String to = "353xxxxxxxxx";
if(rs.next())
{
user = "user";
password = "password";
api_id = "api_id";
baseurl ="http://api.clickatell.com";
text = "Hi from ...";
to =rs.getString("Phone");
}
%>
<html>
<body onload=document.forms[0].s ubmit();>
<form method="post" action="http://api.clickatell.com/http/sendmsg?user=<%=user%>&password =<%=passwo rd%>&api_i d=<%=api_i d%>&to=<%= to%>&text= <%=text%>" >
</form>
<p align="center"> </p>
<p align="center"> </p>
</body>
</html>
<%
{
connection.close();
}
%>
//If you find this problem and dosent work, i'll try
out.println("phone is : -->"+phone); // for the same reason as above
+request.getParameter("nam
//Where the user selects a user from the db ....
ResultSet rs = statement.executeQuery("SE
String name = null;
ArrayList list = new ArrayList();
while ( rs.next() ) {
name=rs.getString("UserNam
list.add(name);
}
%>
<%
{
connection.close();
}
%>
</p>
<p>
Send SMS to:  
<select>
<%
if(list != null)
{
for(int i =0; i < list.size(); i++)
{
String value = (String) list.get(i);
%>
<option value="<%=value%>"><%=valu
<%}
}
else
{%>
<option value=dummy>None</option>
<%}%>
</select>
<p>
<form name="frm1" id="frm1" method="post" action="sent.jsp" onSubmit="return validateForm(frm1)">
<input type="submit" name="Submit3" value="Send">
<p></form> </p>
// The jsp ...
String name = "'" + request.getParameter("name
out.println("user is : -->"+name); // to check if we are getting the user name correctly
ResultSet rs = statement.executeQuery("SE
/*
ResultSet rs = statement.executeQuery("SE
*/
String user = "xxx";
String password = "xxx";
String api_id = "xxx";
String baseurl ="http://api.clickatell.com";
String text = "Hi from ...";
String to = "353xxxxxxxxx";
if(rs.next())
{
user = "user";
password = "password";
api_id = "api_id";
baseurl ="http://api.clickatell.com";
text = "Hi from ...";
to =rs.getString("Phone");
}
%>
<html>
<body onload=document.forms[0].s
<form method="post" action="http://api.clickatell.com/http/sendmsg?user=<%=user%>&password
</form>
<p align="center"> </p>
<p align="center"> </p>
</body>
</html>
<%
{
connection.close();
}
%>
//If you find this problem and dosent work, i'll try
out.println("phone is : -->"+phone); // for the same reason as above
you form is written wrongly...
the select box shd have been inside the form..!!
<p>
<form name="frm1" id="frm1" method="post" action="sent.jsp" onSubmit="return validateForm(frm1)">
<select name="name">
<%
if(list != null)
{
for(int i =0; i < list.size(); i++)
{
String value = (String) list.get(i);
%>
<option value="<%=value%>"><%=valu e%></optio n>
<%}
}
else
{%>
<option value=dummy>None</option>
<%}%>
</select>
<input type="submit" name="Submit3" value="Send">
<p></form> </p>
and then in sent.jsp ( which I am assuming is the same one that we were working on so far).. you do a
request.getParameter("name ");
the select box shd have been inside the form..!!
<p>
<form name="frm1" id="frm1" method="post" action="sent.jsp" onSubmit="return validateForm(frm1)">
<select name="name">
<%
if(list != null)
{
for(int i =0; i < list.size(); i++)
{
String value = (String) list.get(i);
%>
<option value="<%=value%>"><%=valu
<%}
}
else
{%>
<option value=dummy>None</option>
<%}%>
</select>
<input type="submit" name="Submit3" value="Send">
<p></form> </p>
and then in sent.jsp ( which I am assuming is the same one that we were working on so far).. you do a
request.getParameter("name
ASKER
Ok i've changed the above.
In the sent.jsp page, does it matter where I put the
>>request.getParameter("na me");
??
Does the following look correct or which part do I leave out?
String name = "'" + request.getParameter("name ") + "'";
out.println("user is : -->"+name); // to check if we are getting the user name correctly
// or
ResultSet rs = statement.executeQuery("SE LECT * FROM Member WHERE UserName='"+request.getPar ameter("na me")+"'");
Which ever way i put it, it will either bring up a blank page or an error
In the sent.jsp page, does it matter where I put the
>>request.getParameter("na
??
Does the following look correct or which part do I leave out?
String name = "'" + request.getParameter("name
out.println("user is : -->"+name); // to check if we are getting the user name correctly
// or
ResultSet rs = statement.executeQuery("SE
Which ever way i put it, it will either bring up a blank page or an error
your sent.jsp should look like following...
<%
out.print("Administrator logged in: " + session.getValue("UserName ")+ "<br>");
%>
</p>
<p>
<%
Statement statement = null;
ResultSet resultset = null;
ResultSetMetaData rsmd = null;
Connection connection = null;
Class.forName("org.gjt.mm. mysql.Driv er").newIn stance();
connection = DriverManager.getConnectio n(
"jdbc:mysql://localhost/co mbcdte_pro ject?user= combcdte_a dmin&passw ord=*sonyt 630*");
statement = connection.createStatement ();
String name = "'" + request.getParameter("name ") + "'";
System.out.println("user is : -->"+name); // to check if we are getting the user name correctly
ResultSet rs = statement.executeQuery("SE LECT * FROM Member WHERE UserName="+name);
String user = "xxx";
String password = "xxx";
String api_id = "xxx";
String baseurl ="http://api.clickatell.com";
String text = "Hi from ...";
String to = "Phone"; //if this does not work then change the phone number to some hardcoded number for testing
if(rs.next())
{
System.out.println("found phone");
to =rs.getString("Phone");
}
%>
<html>
<body>
<frame src="http://api.clickatell.com/http/sendmsg?user=<%=user%>&password=<% =password% >&api_id=< %=api_id%> &to=<%=to% >&text=<%= text%>"></ frame>
<p align="center"> </p>
<p align="center"> </p>
</body>
</html>
<%
{
connection.close();
}
%>
here I am assuming that you will replace the user and password values to actual values instead of 'xxx'..... see what it prints on the console....
it should be the user name that you selected...
and if it finds the phone number in the data base it will print "found" as well on the console....
<%
out.print("Administrator logged in: " + session.getValue("UserName
%>
</p>
<p>
<%
Statement statement = null;
ResultSet resultset = null;
ResultSetMetaData rsmd = null;
Connection connection = null;
Class.forName("org.gjt.mm.
connection = DriverManager.getConnectio
"jdbc:mysql://localhost/co
statement = connection.createStatement
String name = "'" + request.getParameter("name
System.out.println("user is : -->"+name); // to check if we are getting the user name correctly
ResultSet rs = statement.executeQuery("SE
String user = "xxx";
String password = "xxx";
String api_id = "xxx";
String baseurl ="http://api.clickatell.com";
String text = "Hi from ...";
String to = "Phone"; //if this does not work then change the phone number to some hardcoded number for testing
if(rs.next())
{
System.out.println("found phone");
to =rs.getString("Phone");
}
%>
<html>
<body>
<frame src="http://api.clickatell.com/http/sendmsg?user=<%=user%>&password=<%
<p align="center"> </p>
<p align="center"> </p>
</body>
</html>
<%
{
connection.close();
}
%>
here I am assuming that you will replace the user and password values to actual values instead of 'xxx'..... see what it prints on the console....
it should be the user name that you selected...
and if it finds the phone number in the data base it will print "found" as well on the console....
ASKER
Yep :) ... gettin there
>>it should be the user name that you selected...
and if it finds the phone number in the data base it will print "found" as well on the console....
It prints out the above.
If I leave
>>String to = "Phone";
or hard code it
>>String to = "35386xxxxxxx";
It finds the correct phone no, checked in the view source. Still no message sent though
>>it should be the user name that you selected...
and if it finds the phone number in the data base it will print "found" as well on the console....
It prints out the above.
If I leave
>>String to = "Phone";
or hard code it
>>String to = "35386xxxxxxx";
It finds the correct phone no, checked in the view source. Still no message sent though
and you say that if you cut & paste the url it send the message right???
Hmm.....
alright lets do this..
<html>
<body>
<frame src="http://api.clickatell.com/http/sendmsg?user=<%=user%>&password=<% =password% >&api_id=< %=api_id%> &to=<%=to% >&text=<%= text%>"></ frame>
<p align="center"> </p>
<p align="center"> </p>
</body>
</html>
change this piece to
<html>
<head>
</head>
<script>
window.locaton="http://api.clickatell.com/http/sendmsg?user=<%=user%>& password=< %=password %>&api_id= <%=api_id% >&to=<%=to %>&text=<% =text%>";
</script>
</html>
if your posting to the browser is making it to send the SMS.. this code shd be doing the same thing....
Hmm.....
alright lets do this..
<html>
<body>
<frame src="http://api.clickatell.com/http/sendmsg?user=<%=user%>&password=<%
<p align="center"> </p>
<p align="center"> </p>
</body>
</html>
change this piece to
<html>
<head>
</head>
<script>
window.locaton="http://api.clickatell.com/http/sendmsg?user=<%=user%>&
</script>
</html>
if your posting to the browser is making it to send the SMS.. this code shd be doing the same thing....
ASKER
>> and you say that if you cut & paste the url it send the message right???
exactly!
I duno whats up with it.
Tried the above and its te same as the previous attempts.
If i post it in the URL manually, it sends the message, and then displays an ID number (for that message) on the page
exactly!
I duno whats up with it.
Tried the above and its te same as the previous attempts.
If i post it in the URL manually, it sends the message, and then displays an ID number (for that message) on the page
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Legend ; )
Good stuff that worked.
Brings up the error in explorer with the pop up blocker, but works fine in firefox.
If you happen to find out a way around it to post it properly in the same browser, it would be great, but this is fine thanks.
Good stuff that worked.
Brings up the error in explorer with the pop up blocker, but works fine in firefox.
If you happen to find out a way around it to post it properly in the same browser, it would be great, but this is fine thanks.
here are the things that you will have to change in this jsp..
<%
Statement statement = null;
ResultSet resultset = null;
ResultSetMetaData rsmd = null;
Connection connection = null;
Class.forName("org.gjt.mm.
connection = DriverManager.getConnectio
"jdbc:mysql://localhost/co
statement = connection.createStatement
ResultSet rs = statement.executeQuery("SE
user = "";
password = "";
api_id = "";
baseurl ="http://api.clickatell.com";
text = urlencode("Hi from ...");
to = Phone;
if(rs.next())
{
user =rs.getString("user");
password = rs.getString("password");
api_id = "";
baseurl ="http://api.clickatell.com";
text = urlencode("Hi from ...");
to =rs.getString("phone");
}
%>
<html>
<body onload=document.forms[0].s
<form method="post" action="http://api.clickatell.com/http/sendmsg?user=<%=user%>&password
</form>
<p align="center"> </p>
<p align="center"> </p>
</body>
</html>
<%
{
connection.close();
}
%>