Solved

Posting an ASP Form to Pass values to COM Object

Posted on 2004-04-23
1
425 Views
Last Modified: 2008-02-01
Hi,

I'm a bit new to using COM Objects, basically what i want to do is create a simple form on an .asp page to a reply page passing values to a com object which i have been given. I can hardcode in the API_ID, Username & Password, but i need to pass the TO, MESSAGE & FROM values to the sms_sent.asp page.

I have posted the code below:

send.asp
----------------------------
<FORM action="sms_sent.asp" method=post>
<P ALIGN="CENTER">To:<INPUT name=to> <BR></P>
<P ALIGN="CENTER">Message:<TEXTAREA name=text ROWS="7"></TEXTAREA><BR> </P>
<P ALIGN="CENTER">From:<INPUT name=from>
<INPUT type=submit value=send></P>
</FORM>

sms_sent.asp
-----------------------------
<%@ LANGUAGE="vbscript" %>
<% Option Explicit %>
<SCRIPT RUNAT=Server LANGUAGE="VBScript">
Sub Main
Dim CallInfo
Dim oSMS

Response.Write("Creating the SMS COM object<br>")
Set oSMS = Server.CreateObject("SMS_COMAPI.SMS")
 
Response.Write("Sending a simple SMS<br>")
 
CallInfo = oSMS.SendSimpleSMS(API_ID, "username", "password", "<%=Request.Form("to")%>", "<%=Request.Form("text")%>",  "<%=Request.Form("from")%>")
 
CallInfo = "SMS sending was done with result:" & CallInfo & "<br>"
Response.Write(CallInfo)
 
Set oSMS = Nothing
End Sub
</Script>
 
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
<TITLE>SMS example</TITLE>
</HEAD>
<Body bgcolor="#FFFFFF">
 
Sending a SMS, please wait....<p>
<%
'----Start of send --------------------------------------
 Call Main()  
%>
</BODY>
</HTML>
0
Comment
Question by:fgict
1 Comment
 
LVL 12

Accepted Solution

by:
venkateshwarr earned 500 total points
ID: 10902141
Modify the callinfo line as..

CallInfo = oSMS.SendSimpleSMS(API_ID, "username", "password", Request.Form("to"), Request.Form("text"),Request.Form("from"))
 
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now