Sending A SMS With HTTP POST
Dear Forum members,
I need to send a SMS through the internet with the HTTP POST method in MS Access (2003). Could someone walk me through this process and let me know what the best way is to do this.
I've already searched the forum for some solutions and I came up with some interresting stuff:
http://www.xtremevbtalk.com/showthre...&highlight=sms http://www.xtremevbtalk.com/showthre...&highlight=sms http://www.xtremevbtalk.com/showthre...&highlight=sms http://www.xtremevbtalk.com/showthread.php?t=262820
For example: The url string for the GET statement of a HTTP Request for my SMS message would looke like this:
HTML Code: http://www.smsprovider.com/sms_gateway.php?UN=username&PW=password&GSM=0612345678&MSSG=Test&SENDER=0031612345678&&T=1&E=0 I came up with the following using Microsoft Internet Transfer Control 6.0 (sp4) for the POST:
Code: Private Sub cmdSendSMS_Click()
Dim UN As String, PW As String, GSM As String, MSSG As String, SENDER As String, REF As String, T As String, E As String
UN = "username" PW = "password" GSM = "0612345678" MSSG = "test" SENDER = "0031612345678" REF = "" T = "1" E = "0"
'Create POST for the Internet Transfer Control Dim objInet As Inet Set objInet = Me!axInetTran.Object objInet.Protocol = icHTTP objInet.url = "www.smsprovider.com/sms_gateway.php"
Dim strURL As String, strFormData As String
strURL = objInet.url strPostData = "UN=" & UN & "PW=" & PW & "GSM=" & GSM & "MSSG=" & MSSG & "SENDER=" & SENDER & "T=" & T & "E=" & E axInetTran.Execute strURL, "POST", strPostData
End Sub The problem is, it just doesn't do a thing, not even an error message. Any idea's? Edit by Moderator: Modified the thread title so as not to scare non-VBA people away
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
[VB] Sending Secure Http POST
Hello all,
I am researchering how to send a secure(SSL) transaction(http POST) to one of our web services. I am having little luck in doing this.
I would have thought there is a library to include for this?
any help or re-direction would be appreciated.
regards,
Jay
Post Info To A URL Using Asp Script And Getting Results Like Http Method Post.
I am trying to find script or just where to start.
I want to use asp script (server side) to post some hidden info to another server(URL), then get the info back from the return page and parse through the text to return a page based on the text in the return page.
I Don't want to have the user forwarded to the page that the post is going to I just want to post info to the URL and get the data back. Then create a page based on the data.
Any help with this will be much appreciated.
Thanks,
Dave
HTTP POST In VB6
I have been working on an application that will upload a zip file from a computer to a websever using HTTP POST. I have been able to transmit data that would otherwise appear as text, but I have been having problems with the binary data in the zip file. I can upload it fine using a standard web form (input type="file" name="zip_file"...), but when I try sending the same file from my program, I only get the first 800 bytes or so. Here are some code fragments.
First, This is the code used to make the buffer which will be posted. UrlEncode remove spaces and other forbidden characters from the username. That part works perfectly.
Code:
Private Sub LoadZipFile()
On Error GoTo LoadError
Dim tempBuffer As String
user = mUpload.UrlEncode(user)
mUpload.postBuffer = "handle=" + user + "&zip_file="
Open zipPath For Binary Access Read As #1
Dim length As Long
length = LOF(1)
tempBuffer = String$(LOF(1), 0)
Get #1, , tempBuffer
Close #1
length = Len(tempBuffer)
mUpload.postBuffer = mUpload.postBuffer + tempBuffer
length = Len(tempBuffer)
workState = 6
Exit Sub
LoadError:
MsgBox ("There was an error loading the zip file to memory.")
workState = 9
End Sub
And later after all the connections are made, the buffer sent to the server using this code. hURL is a handle to the script on the server, returned from HttpOpenRequest from the winInet.dll library. HttpSendRequest is part of the same library.
Code:
If HttpSendRequest(hURL, "", 0, postBuffer, Len(postBuffer)) Then
Http Post
I've searched high and low and cant seem to find a straight forward solution to my problem. I'll explain quickly what I'm trying to do. I have added a context menu item in outlook 2003 to capture the html body of an email. I want to send the contents of the variable where I have stored this html body to and ASP but I can't seen to find how to do it. I'm sure I have to use and Http post. HELP PLEASE!! Thanks in advance.
HTTP Post
Hello everyone,
I really hope someone can help me with my problem.
My company recently signed up with a credit card processing firm. Everytime a CC is processed the firm places it onto their website. In order for us to get this information we need to go to their site and enter parameters to view the information. They have supplied me with an html button that I can view the source and see all the parameters that I need to pass so I can view the report. They also informed me that I need to use HTTP Post if trying to use VB to accomplish what their web button did.
I am attempting to create a VB program that will pass these parameters to their site so we can automate this process in the background and don't actually have to visit the site.
Now, for my problem.
I have been attempting to use the Inet.execute , "Post" command to send these parms but it doesn't seem to be working.
I believe that I may have the format wrong or something of that sort.
I have included a text file that has the html code for the button. I did however remove all the login info so if it is clicked you will only see a login screen.
If someone could show me the correct way to send this info to their server I should get a report shown when I run the program.
I 'm hoping someone could give me an example of what I need to do to get this into my VB app.
If I can get it to the page the report is on I can handle retrieving the information from the site.
If I am unclear or anyone would like more info, please let me know and I'll get back to you asap.
File.txt - If this is renamed to File.html it will show a button that can be clicked. When this is clicked it will show a login screen since I removed the login information.
Code.txt - This contains the code I am using in VB to try and perform the same action that the html button is performing.
Thanks in advance for all the help,
Solturus
VBA Http Post
I've searched high and low and cant seem to find a straight forward solution to my problem. I'll explain quickly what I'm trying to do. I have added a context menu item in outlook 2003 to capture the html body of an email. I want to send the contents of the variable where I have stored this html body to and ASP but I can't seen to find how to do it. I'm sure I have to use and Http post. HELP PLEASE!! Thanks in advance.
Http Post
yes I know its been done numerous times but bear in mind I am only 12, so can some one give me some simplified code with comments in it, so I can Post to a CGI from my app, and open the default browser with the results.
Thx
HTTP POST In VB6
I have been working on an application that will upload a zip file from a computer to a websever using HTTP POST. I have been able to transmit data that would otherwise appear as text, but I have been having problems with the binary data in the zip file. I can upload it fine using a standard web form (input type="file" name="zip_file"...), but when I try sending the same file from my program, I only get the first 800 bytes or so. Here are some code fragments.
First, This is the code used to make the buffer which will be posted. UrlEncode remove spaces and other forbidden characters from the username. That part works perfectly.
VB Code:
Private Sub LoadZipFile()On Error GoTo LoadError Dim tempBuffer As String user = mUpload.UrlEncode(user) mUpload.postBuffer = "handle=" + user + "&zip_file=" Open zipPath For Binary Access Read As #1 Dim length As Long length = LOF(1) tempBuffer = String$(LOF(1), 0) Get #1, , tempBuffer Close #1 length = Len(tempBuffer) mUpload.postBuffer = mUpload.postBuffer + tempBuffer length = Len(tempBuffer) workState = 6 Exit Sub LoadError: MsgBox ("There was an error loading the zip file to memory.") workState = 9End Sub
And later after all the connections are made, the buffer sent to the server using this code. hURL is a handle to the script on the server, returned from HttpOpenRequest from the winInet.dll library. HttpSendRequest is part of the same library.
VB Code:
If HttpSendRequest(hURL, "", 0, postBuffer, Len(postBuffer)) Then
HTTP Post
I need some code to post data to a message board.
I had some but it had a problem with it... please add me on msn URL or post here if you think you may be able to help. Thanks in advance, Harry
Http Post
I have a problem sending large data by HTTP POST method.
My problem is send a large XML to an asp page and receive back another XML.
I tried to use CURL and it works fine, but I need to run this process from my application without using shell programs.
Is there someone that knows how can I solve that problem?
Thanks.
HTTP POST
Does anyone know of a reliable HTTP/HTTPS Post control that is multi-threading?
I am currently using the Mabry control, its okay but it garbles some web servers returns, so I am looking for an alternative.
Http Post Perhaps?
I need to do the following:
When the user of my program opens it, I need to check his or her username and password via an ASP page. IE: User opens program, program communicates to the ASP page(http://myserver.com/login.asp), and then verifys the user or denys the user depending on the username and password submitted. Both the ASP and Visual Basic code used to achieve this would be nice, but I'll settle for the Visual Basic code.
I was looking into the inet control for doing this but I have no idea where to start...If someone could kindly point me into the right direction I would appreciate it.
Http Post To Service?
I've been looking through the forums, but, since this is all new to me, I'm afraid I'm more confused now than when I started.
We have a VB app that needs to call a Java service so that the service can update an Oracle database at the completion of a transaction. On the Java side, the developer has offered us a URL to use, but this causes a blank IE sceen to appear. I can use the VB InternetExplorer object and set the Visible property = 0, but we're still seeing the Internet Explorer splash page which will be some what distracting to the user.
What is the best way to connect to this service that that it remains a background process and COMPLETELY unseen by the user?
I've been looking into http post, but I'm not real clear on the best direction (inet, winsock, etc.).
Thanx in advance!!!!
Get/post Http Messages
Hello All,
Please suggest how to send GET/POST messages via HTTP, without using INET or anyother active-x controls?
An example would be even better, can HTTP be used for uploading files to a server?
Thanks,
Zeeshan Alam
www.zeeshanalam.com
HTTP Post Using WININET
Guys,
I neeed your help here in solving my problem. My problem is i was able to do a http post an XML message to a website without username and password. Now I want to do a http post to a website using username and password. For my previous applications I didn't need authentication but now for my new application I need to supply username and password while doing HTTP POST. How do i do that? Please let me know. I appreciate any kind of input on this.
Thanks in advance,
DilSe..
HTTP POST Problem
Hi,
I am looking for a way to post some form variables to a specified location from withing a VB App that will run on a users machine through the compiled exe.
...Any ideas how I can do this?
Much appreciated
Chris
Http Post Method
Hi All,
I need help on the Http Post Method. Does anyone have a Post method example? I know it might be really simple.
I want to create some thing like this: the user clicks on a command button and takes the data from a text box and sends the data from the text box to a server.
Thanks
Chung331
"Don't Worry Be Happy"
VB, Winsock API, HTTP Post
I'm making a program that sends post data to a server. it's been working great until I tried to use my post sub to submit/update a webpage. the problem is it's only sending part of the post data. here is my post code...
Code:
Private Function PostUrl(url As String, data As String, Optional Referer As String = "")
On Error GoTo errHandler
Dim tosend As String
tosend = "POST " & GetDomainPath(url).Path & " HTTP/1.1" & vbCrLf
tosend = tosend + "Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*" & vbCrLf
If Referer <> "" Then tosend = tosend + "Referer: " & Referer & vbCrLf
tosend = tosend + "Content-Type: application/x-www-form-urlencoded" & vbCrLf
tosend = tosend + "Host: " & WinSock1.LocalIP & vbCrLf
tosend = tosend + "Content-Length: " & Len(data) & vbCrLf
tosend = tosend + "Cookie: " & MakeCookieStr(url) & vbCrLf
tosend = tosend + vbCrLf & data & vbCrLf
Header = tosend
txtSource = ""
With WinSock1
If .State <> sckClosed Then .CloseSocket
.RemoteHost = GetDomainPath(url).Site
.RemotePort = 80
.Connect
End With
tmrTimeOut.Enabled = True
PostUrl = PostTag(url, data, Referer, Action)
Exit Function
errHandler:
ErrorIn "frmWebPage.PostUrl(url,data,Referer)", Array(url, data, Referer)
End Function 'PostUrl(url As String, data As String, Optional Referer As String = "")
I looked at data var, it's compleat. so I know it's passing everything. for some reason though it's not "submiting" it all to the page. any ideas on why this may be? btw, I am useing winsock api, just got a class that acts alot like the winsock control. but doesn't need the ocx
Winsock HTTP Post
Basically i wanted to integrate Vonage (VOIP) Click 2 Call Features into My App
I have found the Html Code:
Code:<form action="https://secure.click2callu.com/tpcc/makecall" method="POST">
username <input name="username"><br>
password <input name="password" type="password"><br>
fromnumber <input name="fromnumber"><br>
tonumber <input name="tonumber"><br>
<input type="submit">
</form>
How can i use this within VB rather than a Html File?
Thanks in advance!!
duttydea
Winsock With HTTP-POST
Hi,
I'm fairly new to VB6 and have started working on my second application.
I require the application to send a string to a PHP page on a website and have the PHP page handle the string sent.
I can establish the connection with winsock fine, but i'm unsure as to where to go next.
I've have a decent amount of knowledge with PHP, but just getting the data from VB6 to PHP is where i'm stuck.
After reading numerous posts and tutorials, everything seems to be pointing at using HTTP-POST, but none have succeeded in helping me to accomplish my goal.
If anyone could kick me in the right direction it would be greatly appreciated.
HTTP POST Thread
I need to write a utility that can transmit HTTP POST data to a Proxy server...which shouldn't be a problem. The catch is, I need to transmit with multiple threads, simulating multiple user transmission sessions.
Any ideas?
Receiving An HTTP POST
Can anyone tell me how to receive an HTTP POST on IIS (Microsoft's Internet Information Server)? I need to accept a POST being sent to me. I have found some information at www.jmarshall.com entitled "HTTP Made Really Easy", but something seems to be missing. Maybe I'm pretty thick in the head, but I don't know how to implement this using VB. Any help would be appreciated.
HTTP POST From MS Access 2003
Hi, not been here for a while, it's good to be back.
My problem is sending a HTTP POST of a file via MS Access to a HTML form that contains username, password and filename fields. This was not my choice - at our end we have created the facility for the company to upload the product catalogue, but for some reason they want to upload it via Access - it's not even an Access file they're uploading!
Anyway, they sent me their attempt to fix, but I'm pretty stuck...
Code:
Public Function DoTransfer(ByVal filename As String) As Boolean
'--Constant Variable Declaration--
Const LOCATION = "http://.........."
Const USERNAME = "......"
Const PASSWORD = "....."
Const BOUNDARY = "---------------------------xxxxxxxxxxxx"
'--Variable Declaration--
Dim iFileNum As Integer
Dim lFileLen As Long
Dim strfile As String
Dim request As New WinHttpRequest
'--Convert file to string--
iFileNum = FreeFile
Open filename For Binary Access Read As #iFileNum
lFileLen = LOF(iFileNum)
strfile = String(lFileLen, " ")
Get iFileNum, 1, strfile
'--Header String Creation--
d = "--" & BOUNDARY & vbCrLf
d = d + "content-Disposition: form-data; name=""usernameField""" + vbCrLf + vbCrLf + USERNAME + vbCrLf
d = d + "--" & BOUNDARY & vbCrLf
d = d + "content-Disposition: form-data; name=""passwordField""" + vbCrLf + vbCrLf + PASSWORD + vbCrLf
d = d + "--" & BOUNDARY & vbCrLf
d = d + "content-Disposition: form-data; name=""filenameField"";"
d = d + " filename=""" + filename + """" & vbCrLf
d = d + "Content-type: text/plain" + vbCrLf + vbCrLf
'd = d + "Content-type: application/x-zip-compressed" + vbCrLf + vbCrLf
d = d + strfile & vbCrLf & "--" & BOUNDARY & "--"
'--Convert to Byte--
apostbody = StrConv(d, vbFromUnicode)
'--Run HTTP--
request.Open "POST", LOCATION, False
request.SetRequestHeader "content-type", "multipart/form-data; boundary=" + BOUNDARY
request.Send apostbody
End Function
Basically the code needs to send a file plus a username and password to the form and invoke the submit - the code behind of the page will then do the rest.
The form looks like....
Code:
<table cellspacing="0">
<tr>
<td>Username:</td>
<td><input name="usernameField" type="text" id="usernameField" style="width:230px;" /></td>
<td></td>
</tr>
<tr>
<td>Password:</td>
<td><input name="passwordField" type="password" id="passwordField" style="width:230px;" /></td>
<td></td>
</tr>
<tr>
<td>Filename:</td>
<td><input name="filenameField" type="file" id="filenameField" style="height:22px" /></td>
<td><input type="submit" name="BtUpload" value="Upload" id="BtUpload" style="height:22px;" /></td>
</tr>
</table>
If anyone has any ideas I'd be most grateful!! Thanks....
(Names removed to protect the innocent...)
How To Build An Http Post Request ?
Recently i have been working on a small app that extracts data from a google sevice.
But now google has started an api service that allows users to directly post data to google accounts.here's the link
http://code.google.com/apis/accounts...alledApps.html
Now i have never worked with get/post http requests.So could some one guide on how to build one and then work with the responses that have arrived
Thanks
Http Post Multipart/related
Hi,
I have to send 2 xml files to a server with post.
Actualy is a Wap Push message (PAP & SI)
I must use multipart/related (to send both xml files with one post)
I have read about boundary. I try that
VB Code:
Set oHttp = New XMLHTTPboundary = "asdlfkjiurwghasf"oHttp.open "POST", "http://someserver.com/", False ', "login", "passwd" oHttp.setRequestHeader "Content-Type", "multipart/related; type=application/xml; boundary=" & boundarystrBody = "" 'PAPstrBody = "--" & boundary & vbCrLfstrBody = strBody & "Content-Type: application/xml" & vbCrLf & vbCrLf strBody = strBody & "<?xml version=##1.0##?>" & vbCrLfstrBody = strBody & "<!DOCTYPE pap PUBLIC ##-//WAPFORUM//DTD PAP 1.0//EN## ##http://www.wapforum.org/DTD/pap_1.0.dtd##>" & vbCrLfstrBody = strBody & "<pap>" & vbCrLfstrBody = strBody & "<push-message push-id=##101@sports-comm.gr## deliver-before-timestamp=##2020-12-20T16:54:45Z## deliver-after-timestamp=##2001-01-22T16:57:32Z##>" & vbCrLfstrBody = strBody & "<address address-value=##wappush=3069955441122/type=PLMN@ppg.nokia.com## />" & vbCrLfstrBody = strBody & "<quality-of-service priority=##medium## delivery-method=##unconfirmed## bearer=##SMS##/>"strBody = strBody & "</push-message>" & vbCrLfstrBody = strBody & "</pap>" & vbCrLf & vbCrLfstrBody = strBody & "--" & boundary & vbCrLf 'SI'strBody = strBody & "Content-Type: application/xml" & vbCrLf & vbCrLfstrBody = strBody & "Content-Type: text/vnd.wap.si; charset=ISO-8859-7" & vbCrLf & vbCrLfstrBody = strBody & "<?xml version=##1.0##?>" & vbCrLfstrBody = strBody & "<!DOCTYPE si PUBLIC ##-//WAPFORUM//DTD SI 1.0//EN## ##http://www.wapforum.org/DTD/si.dtd##>" & vbCrLfstrBody = strBody & "<si>" & vbCrLfstrBody = strBody & "<indication href=##[url]http://someserver.com/videos/sample.3gp##[/url] si-id=##101@sports-comm.gr## created=##2002-10-30T20:18:43Z## si-expires=##2020-12-20T16:54:45Z## action=##signal-high##>" & vbCrLfstrBody = strBody & "New video" & vbCrLfstrBody = strBody & "</indication>" & vbCrLfstrBody = strBody & "</si>" & vbCrLf & vbCrLfstrBody = strBody & "--" & boundary & "--" & vbCrLfstrBody = Replace$(strBody, "##", Chr$(34))aPostData = StrConv(strBody, vbFromUnicode)oHttp.send aPostDataMsgBox oHttp.responseText
Is that the correct way to built a multipart post?
thanks in advance
How To Make HTTP POST From My Vb Form
HI all i wonsder how i can make a post request from a .php script from with in my applicaton. PAsssing it certian data and getting the request response back to a textbox. Just Like the pic i shown here. I did the layout but i do not how to write the onclick event for send button so it sends the post request. I be happy if any one help me to do that.Thanks
HTTP Header With Post Conent
I was wondering how i would use VB to post a header to a website with post content. i did it in php and it worked here is the header. im pretty sure there are some thing i can leave out in the header, not totaly sure tho. the php script that worked is at the bottom.
url: http://myspace.com/index.cfm?fuseaction=login.process
Host: myspace.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://myspace.com/
Cookie: IID=; EVENTLOCALE=0%5E90021%5ELOS+ANGELES%2C+CA%5E10; FRNDID=25834115; DERDB=ZG9tYWluPXNiY2dsb2JhbCZ0bGQ9bmV0JnNtb2tlcj0wJnNleHByZWY9MSZ1dHlwZT0xJnJlbGlnaW9uaWQ9MCZyZWdpb2 49JnBvc3RhbGNvZGU9OTU2OTUmbWFyaXRhbHN0YXR1cz1TJmluY29tZWlkPTAmaGVpZ2h0PTE4MyZnZW5kZXI9TSZmcmllbmRzPT EmZXRobmljaWQ9OCZhZ2U9MTgmYm9keXR5cGVpZD0xJmNoaWxkcmVuaWQ9MSZjb3VudHJ5PVVTJmRhdGluZz0wJmRyaW5rZXI9LT EmZWR1Y2F0aW9uaWQ9MQ%3D%3D; TIMEZONE=0; REVSCI=1; AUTOSONGPLAY=0; MSCOUNTRY=US; MYSPACE=myspace; BLOCKCOOKIEDISABLE=; COUNTRYCODE=MFIGCSsGAQQBgjdYA6BFMEMGCisGAQQBgjdYAwGgNTAzAgMCAAECAmYDAgIAwAQI55N1%2F%2FsAka4EEJM%2BVe i2FEgH9f3I8ftuMxkECNL%2BLZ0%2Bp71T
Content-Type: application/x-www-form-urlencoded
Content-Length: 94
post content:
email=eastonhockey19%40sbcglobal.net&password=password&Submit22.x=0&Submit22.y=0&Submit22=LOGIN
PHP Code:
<?php
$tmp_cookie_file=tempnam("/tmp", "msautoupdate_cookie");
$ms_userid = "eastonhockey19@sbcglobal.net"; //Your myspace email, please replace within quotes
$ms_passwd = "password"; //Your myspace password, please replace within quotes
$defined_vars = get_defined_vars();
//login url
$login_url = 'http://blog.myspace.com/index.cfm?fuseaction=login.process';
$login_params = "email=$ms_userid&password=$ms_passwd&Remember=0?";
// create a new curl resource
$ch = curl_init();
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, $login_url);
curl_setopt($ch, CURLOPT_POSTFIELDS,$login_params);
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_USERAGENT, $defined_vars[’HTTP_USER_AGENT’]);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_COOKIEJAR, $tmp_cookie_file);
$result = curl_exec ($ch);
curl_close ($ch);
?>
http://www.php.net/curl_setopt
thanks in advance
<solved> VB6 Application HTTP POST To ASP
Stuck with what appears to be quite a simple problem....
Trying to send an SQL statement to a database via ASP using a client application (written in VB for now as thats all i;ve got at home)
Here's the subroutine from the VB Application
VB Code:
Private Sub Synchronise_Click() Dim oXMLHttp Dim oADORec Dim sXML Dim URL Dim getxml Dim anothing Dim aString aString = "sqlsentence=SELECT+*+FROM+Data" Set oXMLHttp = CreateObject("MSXML2.XMLHTTP") URL = "http://localhost/test/default.asp" oXMLHttp.Open "POST", URL, False oXMLHttp.send aString If oXMLHttp.Status = 200 Then sXML = oXMLHttp.responseText ' Retrieve from server End If Set oXMLHttp = Nothing End Sub
Here's the ASP code :-
the config.asp sets up the database connection
Code:
<!--#include file="config.asp"-->
<%
on error resume next
dim mySQL, conntemp, rstemp, counter, version
call openDb()
' get SQL sentence from previous form
mySql= request.form("sqlsentence")
if mySql="" then
response.redirect "message.asp?message="&Server.Urlencode("Please enter a valid query")
end if
counter=0
set rstemp=conntemp.execute(mySQL)
<............snip>
sqlsentence isn;t getting passed onto the asp page.
any ideas?
Testing POST To HTTP Form
I'm trying to learn about HTTP POST to 1. fill in form data and 2. to send a file in the POST header.
I'm using the code below:
Private Sub Command1_Click()
Dim strURL As String, strFormData As String
strURL = "url with a static form and submit button"
strFormData = "text1=fromVB_post&text2=second_line "
Inet1.Execute strURL, "POST", strFormData, _
"Content-Type: application/x-www-form-urlencoded" & vbCrLf & vbCrLf
Do Until Form1.Inet1.StillExecuting = False 'wait 4 dwnld
DoEvents
Loop
Debug.Print strFormData & " " & strURL
'waiting
Debug.Print Inet1.OpenURL("http://www.yahoo.com")
End Sub
But of course I don't have code there which will cause the data to be submitted. Instead, I get a 405 error on the page. This seems like it should be easy, but it doesn't work. The key here is submitting to a dumb form. Right now I'm trying to post to a form created using frontpage extensions, and eventually I'll post to a web server running cgi.
Any ideas?
How To Post Binary File Using HTTP ???
Hi,
I'm hoping someone can show me how to post a binary file trough http form using VB. I tried 2 different things already. I tried to use the IPWorks! V4 HTTP compoenent, and the other one is MSXML30.
Actually the problem is it won't let me upload any file (not even plain/text file type). I know for sure that the posting acceptor script is working just fine because I can do upload using web browser (IE and Netscape).
This is the error message that I get from the IIS :
Error occurred when moving cached file to final destination........
Thanks.
Capture Http Requests (post + Get)
Folks, need to write a program that will capture the http requests going to and from an app. I would like to do this using vbs inside of excel so I can store the requests in side of excel and replay them later. Any body smart enough (or wise enough) to know how to start or has done this already. Any help would be greatly appreciated.
thanks in advance
mlp
How To Make HTTP POST From My Vb Form
HI all i wonsder how i can make a post request from a .php script from with in my applicaton. PAsssing it certian data and getting the request response back to a textbox. Just Like the pic i shown here. I did the layout but i do not how to write the onclick event for send button so it sends the post request. I be happy if any one help me to do that.Thanks
Http Post Visual Basic
Hi I am doing a program that I have to send a message in XML with HTTPPost I wonder What is the best way to do it I am reading about SOAP and I think That is but still I am not quite sure. I have The end point to send it and the message go to a Card Access Manager(CAM). If somebody could help me please I will really appreciate.
Thanks
Maria
Capturing HTTP-POST From IE Control Within VB
Hi All,
Problem Statement:
I've a Stand-alone PC, No connection to Internet nor any other kind of network / web-server. Only Win 9x or NT or 2K installed, *no* local web server (PWS/IIS). I would load a HTML page on local machine in a WebBrowser Or InternetExplorer control from a VB application. The HTML page would be some form with typical data entry controls such as list-boxes, text area, radio buttons, check boxes etc. It would be Javascript based validations and dynamic controls generation. The form would have a button which would either use a post method or query-string method to send the form data to other page / web-server.
As there is no web server (not even localhost) to post, I would like capture all the form data inside the VB application and store it in local disk. That means I should be able to capture the POST or GET event of the browser control.
Please help me in achieving this.
Thanks & best regards,
Prasad
Winsock HTTP POST - How Can You Send Files?
Like how can you send files that are sent by webbrowsers in the
<input type=file..> element?
anyone know?
i think its done by MIME, but how would you know what headers to use?
Http Post File Upload (binary)
know you can do this with ie (html) using a <input type="file" name="attachment">, but i need this functionality in a vb app. do i need to manually do a base64 encode on the file and attach it to a multi-part request or can i call some api/dll/whatever that ie uses?? i am a new vb programmer so please, any help would be greatly appreciated.
Inet Control, Http POST With Text & Files
Hi!
I'm trying to create an activex control for use on a web page that allow drag 'n drop functionality. (user select multiple files on their desktop, drags them onto the web page (specifically the activex control) which then uses the inet control to post (via http) the files to an asp page.
I'm actually pretty far along. I've looked through these forums and found some great examples. For the most part though, it looks like the examples are for text (data retrieved from text fields).
Right now I'm stuck on assembling the post data before handing it off to the inet control. I've created boundaries (unique to each post) and have the correct header information (strHeaderData)
strHeaderData and strPostData are both strings. I *think* that the inet control is expecting a string as post data, but I'm not sure. When the user selects a couple of images to upload, I need to read the file information and (I guess) add it to the strPostData? (This is where I am a little confused) I'm using the FileSystemObject to open the file and used the .readall method to get the contents into a string. Is this the correct way of doing it? A gif or jpg would contain binary information - is the conversion happening behind the scenes or do I have to do it manually. (my next question - which formats do I need to convert to and from)
Sorry if I sound confused. My background is really in vbscript & C#. I've only done a couple of "visual basic" projects and I'm sure they could be better.
Thanks!
Emi ^_^
Get/read/display Etc Current URL / HTTP Addy After POST
i am using this code, and once the POST has concluded, i wanted to be able to get the current URL:
[code]
Public objHTTP As New MSXML.XMLHttpRequest
Private Sub example()
Dim strWebPage As String
strWebPage = "http://wherever.com"
objHTTP.Open "POST", strWebPage, False
objHTTP.setRequestHeader "Connection", "Keep-Alive"
objHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
submurl = "siteId=&uname=hello&pwd=there"
objHTTP.send submurl
Do While objHTTP.readyState <> 4
DoEvents
Loop
' let's assume that the POST was successful and left me in a different place than where i started (i.e. wherever.com)
'how do i get the current URL of the page i just landed on?
>> msgbox display current URL
end sub
anyone know how to do this?
Images In Byte Array For Binary Http POST?
Hello,
I am having trouble building a multipart form post that must contain images
in binary format.
Building the text parts of the form is no problem and working fine, however
I am not sure how to build the images ( which can be accessed either from a
SQL BLOB or the file system) into the POST data.
I was thinking a byte array may be an option as I can use the StrConv functi
on to store the text in the array but am not sure how I can add the jpeg to
the array? I believe i can post the entire array using xmlHttp
Other suggestions appreciated - whatever gets me home and I'll go the long w
ay as this is urgent!
thanks in advance
HELP: Winsock To Send HTTP POST REQUEST To A Machine
Hello,
I would like to use visual basic to send data to a machine using an HTTP Post request, and cannot decide on the best way to do it. Can I use winsock. Please bear in mind the following.
I am sending a mult-part message (kind of like an email with attachments). It's actually a multimedia message in the MM7 format -> this is similar to email, a multipart MIME message.
I MUST post to a destination using the following format:
http://192.168.3.75:2097/mm7
I need to then send the data which I've formated according to the MM7 spec.
I need to receive responses from the receving application.
Any help would be greatly appreciated.
Thanks
Ben
VB Upload File Chinese OS - HTTP Post Body Method- HELP !
Hi Guys,
Me trying to upload file using VB HTTP Post method. Can successfully upload the files when my client machine is English OS . However , the problem occurs when am trying to upload the files from Chinese OS. It seems that the file uploaded is getting corrupted and could not be opened in correct format. This is applicable for binary files. The text files could be uploaded successfully.
I have tried setting content-type, charset,codepage etc properties to assemble the body.
Can anyone help me ? Its urgent ....Hope to find some VB GURU in this group.HELP !
Thanks in advance,
Ashish.0.
Part of the code :
--------------------------------------------
Sub uploadFile(a_strUserName As String, a_strUserPassword As String, a_strDigiteServerURL As String, a_strFilename As String, a_strFileTitle)
On Error GoTo err_uploadFile
Const HTTPREQUEST_PROXYSETTING_DEFAULT = 0
Const HTTPREQUEST_PROXYSETTING_PRECONFIG = 0
Const HTTPREQUEST_PROXYSETTING_DIRECT = 1
Const HTTPREQUEST_PROXYSETTING_PROXY = 2
Const HTTPREQUEST_SETCREDENTIALS_FOR_SERVER = 0
Const HTTPREQUEST_SETCREDENTIALS_FOR_PROXY = 1
' WinHTTPRequest options
Const WinHttpRequestOption_UserAgentString = 0
Const WinHttpRequestOption_URL = 1
Const WinHttpRequestOption_URLCodePage = 2
Const WinHttpRequestOption_EscapePercentInURL = 3
Const WinHttpRequestOption_SslErrorIgnoreFlags = 4
Const WinHttpRequestOption_SelectCertificate = 5
Const WinHttpRequestOption_EnableRedirects = 6
Const WinHttpRequestOption_UrlEscapeDisable = 7
Const WinHttpRequestOption_UrlEscapeDisableQuery = 8
Const WinHttpRequestOption_SecureProtocols = 9
Const WinHttpRequestOption_EnableTracing = 10
Const SslErrorFlag_Ignore_All = 13056
Const HTTP_STATUS_PROXY_AUTH_REQ = 407
Const HTTP_STATUS_DENIED = 401
Const HTTP_STATUS_OK = 200
Dim strFile As String
Dim strURL As String
Dim strBody As String
Dim aPostBody() As Byte
Dim nFile As Integer
' Read the file from the hard disk
nFile = FreeFile
Open a_strFilename For Binary As #nFile
strFile = String(LOF(nFile), " ")
Get #nFile, , strFile
Close #nFile
''' Dim w_objWinHttpRequest As New WinHttp.WinHttpRequest
Dim w_strRequestURL As String
Dim w_strProxyURL As String
''' Set g_objWinHttpRequest = CreateObject("WinHttp.WinHttpRequest.5.1")
w_strProxyURL = getProxyURL()
If Len(w_strProxyURL) > 0 Then
g_objWinHttpRequest.SetProxy HTTPREQUEST_PROXYSETTING_PROXY, w_strProxyURL, getProxyByPassServerList()
End If
w_strRequestURL = a_strDigiteServerURL & JSP_FILE_UPLOAD
g_objWinHttpRequest.SetTimeouts 0, 0, 0, 0
g_objWinHttpRequest.Open "POST", w_strRequestURL, False
' Set the header < here i have tried setting the charset , codepage parameters too but of little use as on the server 'side the extraction of the zip file is not done according to the given encoding method.>
g_objWinHttpRequest.SetRequestHeader "Content-Type", "multipart/form-data; boundary=Xu02=$"
' Assemble the body
strBody = "--Xu02=$" & vbCrLf & _
"Content-Disposition: form-data; name=""TestFile""; filename=""" & a_strFileTitle & """" & vbCrLf & _
"Content-type: file" & vbCrLf & vbCrLf & _
strFile & vbCrLf & _
"--Xu02=$--"
' Because of binary zeros, post body has to convert to byte array
aPostBody = StrConv(strBody, vbFromUnicode, g_lngLocaleID) 'vbFromUnicode
WriteToLogFile ("strbody :" & strBody & " localeid: " & g_lngLocaleID)
g_objWinHttpRequest.Option(WinHttpRequestOption_EnableHttpsToHttpRedirects) = True
g_objWinHttpRequest.Option(WinHttpRequestOption_SelectCertificate) = True
g_objWinHttpRequest.Option(WinHttpRequestOption_SslErrorIgnoreFlags) = SslErrorFlag_Ignore_All
g_objWinHttpRequest.SetClientCertificate "LOCAL_MACHINEOther People"
g_objWinHttpRequest.Send aPostBody 'posts the body to JSP.
If g_objWinHttpRequest.Status = HTTP_STATUS_DENIED Then
g_objWinHttpRequest.SetCredentials a_strUserName, a_strUserPassword, HTTPREQUEST_SETCREDENTIALS_FOR_SERVER
g_objWinHttpRequest.Send aPostBody
End If
Exit Sub
err_uploadFile:
m_ErrorDesc = "err_uploadFile [ERROR] : " & err.Description
m_ErrorFlag = True
WriteToLogFile "err_uploadFile [ERROR] : " & err.Description
End Sub
---------------------------------------------
|