Hel with making get request for registeration
Hi all i got a form that has 3 textbox and one button . The textboxes holds:
username,password and email. I want to collect these textbox input and make a get request and execute it. But i do not know how to pass the data of textbox to the registeration url shown beleow. The bold parts are data from textboxes.The rest of data in url are static. I be happy if some on help me pass text box data to this url and execut it.Thanks
VB Code:
http://register.mysite.com/reg/ControllerServlet?RequestId=Register.RegisterPalUser&txt_NickName=[B]Kowareta+Koss+Kadem[/B]&pwd_Psd=[B]worldpeace[/B]&pwd_ConfPsd=[B]worldpeace[/B]&sel_SecretQuestion=1&hid_SecretQuestion=What+is+the+name+of+the+street+you+grew+up%3F&txt_SecretAnswer=ptdnet&sel_Year=1979&txt_FirstName=Qsadasd&txt_LastName=dasd&sel_Sex=1&txt_EmailID=[B]
[email protected][/B]&txt_EmailConfirm=[B]
[email protected][/B]&Country=US&txt_Zip=10017&chk_USOffer=Y&chk_Affiliate=Y&strAction=Registration
Re: Hel with making get request for registeration
VB Code:
Dim a, b, c As String
a = "http://register.mysite.com/reg/ControllerServlet?RequestId=Register.RegisterPalUser&txt_NickName="
b = "&pwd_Psd="
c = "&pwd_ConfPsd=worldpeace&sel_SecretQuestion=1&hid_SecretQuestion=What+is+the+name+of+the+street+you+grew+up%3F&txt_SecretAnswer=ptdnet&sel_Year=1979&txt_FirstName=Qsadasd&txt_LastName=dasd&sel_Sex=1&txt_EmailID="
inet.execute = a & Text1 & b & Text2 & c
It would go like that (assuming you have a inet control)
Re: Hel with making get request for registeration
Quote:
Originally Posted by trinic
VB Code:
Dim a, b, c As String
a = "http://register.mysite.com/reg/ControllerServlet?RequestId=Register.RegisterPalUser&txt_NickName="
b = "&pwd_Psd="
c = "&pwd_ConfPsd=worldpeace&sel_SecretQuestion=1&hid_SecretQuestion=What+is+the+name+of+the+street+you+grew+up%3F&txt_SecretAnswer=ptdnet&sel_Year=1979&txt_FirstName=Qsadasd&txt_LastName=dasd&sel_Sex=1&txt_EmailID="
inet.execute = a & Text1 & b & Text2 & c
It would go like that (assuming you have a inet control)
Thank u for u reply. I tried like this and keep getting object required at inet.execute line . the massage box shows all the data corectly but the execut point shows error. I tried both using & and + and i get same error:
VB Code:
Private Sub Command4_Click()
Dim var1 As String
var1 = "http://register.mysite.com/reg/ControllerServlet?RequestId=Register.RegisterPalUser&txt_NickName="
Dim name As String
name = Text1.Text
Dim var2 As String
var2 = "&pwd_Psd="
Dim password As String
password = Text2.Text
Dim var3 As String
var3 = "&pwd_ConfPsd="
Dim passconfirm As String
passconfirm = Text2.Text
Dim var4 As String
var4 = "&sel_SecretQuestion=1&hid_SecretQuestion=What+is+the+name+of+the+street+you+grew+up%3F&txt_SecretAnswer=ptdnet&sel_Year=1979&txt_FirstName=Qsadasd&txt_LastName=dasd&sel_Sex=1&txt_EmailID="
Dim email As String
email = Text3.Text
Dim var5 As String
var5 = "&txt_EmailConfirm="
Dim emailconfirm As String
emailconfirm = Text3.Text
Dim var6 As String
var6 = "&Country=US&txt_Zip=10017&chk_USOffer=Y&chk_Affiliate=Y&strAction=Registration"
MsgBox "variables:" + var1 + name + var2 + password + var3 + passconfirm + var4 + email + var5 + emailconfirm + var6
'Inet.Execute = var1 & name & var2 & password & var3 & passconfirm & var4 & email & var5 & emailconfirm & var6
[B]Inet.Execute = var1 + name + var2 + password + var3 + passconfirm + var4 + email + var5 + emailconfirm + var6[/B] ==> error here. object required
End Sub
Re: Hel with making get request for registeration
Have you referenced the inet control? Added it to your form?
Re: Hel with making get request for registeration
Quote:
Originally Posted by randem
Have you referenced the inet control? Added it to your form?
i put the inet controle already !! but i keep getting error!!
Re: Hel with making get request for registeration
Try placing all your variable into one variable and doing a debug.print to find out just what your variable looks like. Then post it.
ie.
VB Code:
somevar = var1 + name + var2 + password + var3 + passconfirm + var4 + email + var5 + emailconfirm + var6
debug.print somevar
Re: Hel with making get request for registeration
try this...
VB Code:
WebBrowser1.Navigate2 var1 + name + var2 + password + var3 + passconfirm + var4 + email + var5 + emailconfirm + var6
replace webbrowser1 with whatever yours is named
Re: Hel with making get request for registeration
Quote:
Originally Posted by randem
Try placing all your variable into one variable and doing a debug.print to find out just what your variable looks like. Then post it.
ie.
VB Code:
somevar = var1 + name + var2 + password + var3 + passconfirm + var4 + email + var5 + emailconfirm + var6
debug.print somevar
It prints the url correctly . the massage box also prints corectly :
VB Code:
http://register.mysite.com/reg/ControllerServlet?RequestId=Register.RegisterPalUser&txt_NickName=Attila Haramy&pwd_Psd=kingjan&pwd_ConfPsd=kingjan&sel_SecretQuestion=1&hid_SecretQuestion=What+is+the+name+of+the+street+you+grew+up%3F&txt_SecretAnswer=ptdnet&sel_Year=1979&txt_FirstName=Qsadasd&txt_LastName=dasd&sel_Sex=1&
[email protected]&
[email protected]&Country=US&txt_Zip=10017&chk_USOffer=Y&chk_Affiliate=Y&strAction=Registration
Re: Hel with making get request for registeration
Did you try what trinic stated?
Re: Hel with making get request for registeration
Use the suggestions I noted above, I've tried it and it works (if i had a valid user/pass) it would work, it took me to the right page but said my site is unavailable.
Re: Hel with making get request for registeration
Quote:
Originally Posted by trinic
Use the suggestions I noted above, I've tried it and it works (if i had a valid user/pass) it would work, it took me to the right page but said my site is unavailable.
well it worked but is there away to do this wihtout webbrowser controle?
Re: Hel with making get request for registeration
what is it your trying to do? pass it to IE?
Re: Hel with making get request for registeration
if it is, you need to do this....
Place this code at the top of all your coding in your form...
VB Code:
Option Explicit
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
then place this code in your button...
VB Code:
ShellExecute hwnd, "OPEN", var1 + name + var2 + password + var3 + passconfirm + var4 + email + var5 + emailconfirm + var6, "", "", 3
Re: Hel with making get request for registeration
Or using MS XML 2.0 .. gets the text also ..
depends what you want to do ..
VB Code:
'// REFERENCE Microsoft XML, Version 2.0
Private Sub Command1_Click()
Dim strText As String
strText = SendRequest("http://www.myurl.com/mypage.asp?usr=me&pass=to")
If Len(strText) Then
Debug.Print strText
End If
End Sub
Private Function SendRequest(ByVal strUrl As String) _
As String
On Error Resume Next
Dim objHTTP As New MSXML.XMLHTTPRequest
objHTTP.Open "GET", strUrl, False
objHTTP.setRequestHeader "Content-Type", "text/html"
If Err = 0 Then
objHTTP.send
SendRequest = objHTTP.responseText
End If
End Function
Re: Hel with making get request for registeration
Quote:
Originally Posted by trinic
Use the suggestions I noted above, I've tried it and it works (if i had a valid user/pass) it would work, it took me to the right page but said my site is unavailable.
Many thanks for suggestion . could u tell me how to make error checking detect error. For example if some thing was wrong with registeration i usualy get directed to this url not the actual url that holds all the registeration info as i posted above :
Code:
http://register.mysite.com/reg/ControllerServlet?RequestId=Register.RegisterUser
What that happens I want record that username that failed and place it in seperated listbox. could u tell me how i can detect that fail and place that registeration info in to failed listbox?Thanks
Re: Hel with making get request for registeration
Quote:
Originally Posted by trinic
what is it your trying to do? pass it to IE?
Thank u for reply. I just want to execute the url and if it refares me to diffrent url then detect and record that registeration info . For example if it failes i want to add that username to failes listbox.