Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Send SMS by Web 2

Status
Not open for further replies.

MongkonB

Programmer
Jan 7, 2004
9
TH
Hi all

I have a VFP app to send SMS to mobile by internet.Below is example code.How can to code in VFP3.0.
Thank's Very much
MongkonB




<HTML>

<HEAD>

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-874">

<TITLE>How to post data in Send Format</TITLE>

</HEAD>

<BODY>

<FORM action= method="POST">
TEST SMS to Mobile <BR><BR>

Mobile Number : <input type="text" name="Msn" maxlength="10" size="12" value="66XXXXXXXX"><BR>

Message Type[T/E]: <input type="text" name="MsgType" value="E"><BR>

Message <input type="text" name="Msg" size="100" value="Text to test send"><BR>

<!User <input type="text" name="User" value="testuser"><BR>

<!Password <input type="text" name="Password" value="testpassword"><BR>

<input type=submit value="Submit">

<input type=reset value="Reset">

</form>

</BODY>

</HTML>
 

There are a lot of Activex available on the Internet to send SMS messages. Here are a few:
Directory - SMS Tools



Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
See "How To Programmatically Fill In a Form (HTTP GET/POST)" faq184-4359

The method there should work fine in VFP3, provided WinSock v2 is installed.

- Bill

Get the best answers to your questions -- See FAQ481-4875.
 
Thank's Mike and Bill. I want to study HTTP,TCP/IP Mechanism ,for " How To Programmatically Fill In a Form (HTTP GET/POST)" I don't understand "FUNCTION httpPost( pcServer, pcUrl, pcData, poFdbk )". What shoud I put value in "poFdbk" ?. What is "poFdbk " in FUNCTION httpPost()?.
Thank ' Bill
 
To use the SocketWrapper class, simply instantiate it, then call the HTTPPOST function, handing it the paramters.

The result is .T. if success, .F. if not.

the downloaded page is stored in .cIn

pcServer: the domain name of the server, without "pcUrl: the path on the server to the cgi receiving the post... ie: "/cgi-bin/search.cgi"
pcData: URL-Encoded data... say, for fields "srchfld" and "mode": "srchfld=find%20this&mode=XML"

poFdbk: this is optional; if provided, it should be an object with a method called "feedback" that takes one parameter, which is the percentage (0..100) of the pcData that has been uploaded. poFdbk can be any object, even a form, which makes providing the UI easier.


so:
Code:
xx=create('SocketWrapper')
if xx.httpPost('my.server.com','/cgi-bin/search','srchfld=find%20this&mode=XML')
  * Search was successful
  * Result is in xx.cIn
endif

- Bill

Get the best answers to your questions -- See FAQ481-4875.
 
What is it you're trying to use vfpWinSock to do?

There are many different kinds of "proxies": email (POP) proxies, web (HTTP) proxies, ftp proxies, etc.

If you only have HTTP-Proxy access to the internet, then you cannot use POP to send an email, because there's no way to 'talk POP-protocol' though an HTTP proxy.

The vfpWinSock class is designed to mimic the mswinsck.WinSock ActiveX class, and doesn't provide HTTP support at all (let alone HTTP-proxy support), though you can use vfpWinSock and code the proxy calls yourself.

I know this seems confusing, but I'm finding it hard to clearly focus on a particular issue since I'm not sure what you're trying to use vfpWinSock to do....

- Bill

Get the best answers to your questions -- See FAQ481-4875.
 
Thank's Bill
I'm new for coding in TCP/IP protocol. I use complete programme for my app..
I have MS Win98,VFP3.0. I develope database app. for many year,but last year ago I know that VFP3.0 can use Win32_API,socket function form .
I use vfpWinSock class connect to internet so I thing it's way to develope my app.,Send SMS by web
The proxy I thing that's web (HTTP) proxy. Can you tell me how to develope my app..
Thank's
-MongkonB
 
I don't have much experience with the HTTP proxy protocols, but I found references to this variant of HTTP in RFC 1945 ( ) and RFC 2068 ( ).

Check out this page, too:
Search for the phrase in it "HTTP PROXY CONNECTIONS HTTP" and read that section to figure out how the proxy works.
----
This seems to work with my proxy server:
Code:
* Where pcServer is the address/name of the proxy server
* and pcURL is the server and path that you want to retrieve
* something like:

*   ox = create('httpSocketWrapper')
*   ox.port = 8080 && My proxy's port number
*   ox.httpGet( '192.168.0.10', '[URL unfurl="true"]http://www.yahoo.com/'[/URL] )
*   strtofile(ox.cIN, 'Temp.htm') && vfp6 function... you'll need an alternative
*   shellExec('temp.htm)  && my wrapper to the winapi ShellExecute()
FUNCTION httpGet( pcServer, pcUrl )
    LOCAL lResult
    THIS.Host = pcServer
    IF THIS.Connect()
        THIS.snd("GET "+pcURL+" http/1.0"+crlf)
        THIS.snd("Accept: */*"+crlf)
        THIS.snd("Accept-Language: en-us"+crlf)
        THIS.snd("Accept-Encoding: gzip, deflate"+crlf)
        THIS.snd("User-Agent: Mozilla/4.0"+crlf)
        THIS.snd("Host: "+pcServer+crlf)
        THIS.snd("Pragma: no-cache"+crlf)
        THIS.snd(crlf,.t.) && End of headers
        *info=url encoded string
        lResult = .T.
    ELSE
        lResult = .F.
    ENDIF
    THIS.Disconnect()
  ENDFUNC


- Bill

Get the best answers to your questions -- See FAQ481-4875.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top