Solved

Posting an ASP Form to Pass values to COM Object

Posted on 2004-04-23
1
446 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VBScript FormatCurrency - how to change the currency symbol 4 52
Pass through dll 2 91
innerHTML 7 34
Code Manager | Snippits 2 35
I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

789 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