HTMLViewer LoadURL

I’m trying to make simple blog increaser on my counter, well with HTTPSockets i dont know working yet and i tried but not increasing page count on live webcounter, so i get idea to make htmlviewer and load it there.
So what I’m trying to do is to tell my app to load my website blog BUT first it have to go throught the google search and by looking my tags i set in textfield, going after to the textfield2 final destionation my blog url.

So I have:

  1. TagsField.Text
  2. URLField.Text
  3. HTMLViewer
  4. GoButton
HTMLViewer1.LoadURL("https://www.google.lu/search?q="  +TagsField.Text and URLField.Text)

But this doesnt work :frowning:
So again the steps IF IT’S possible:
I hit GO and it will go to google search and type and show the “TAGS” what i enter in app to the “TagsField.Text” and then once it load in HTMLViewer1, it will go to the URLField.Text (my blog url)

Thanks for any help or topic where could i found more info.
PS: Please as i saw many laughing on me here, note i’m just a very beginner and i want to learn, so i do appreciate more explication if you will take your time.

Difficult to exactly explain what is going wrong for you. Could you come up with a real example (real URL + tags) from a web side. You don’t have to use your own Web site.

If you test you own example in a web browser (“https://www.google.lu/search?q=” +TagsField.Text and URLField.Text) do you get the right result ?

Well i have a error, but when I delete urlfield.text, i get results in htmlviewer1 the tags i type in textfield, so it show up but with following in browser search: “tags+https://www.google.lu/search?q”

And real example? Well ijust said I have 2 textfields where i enter 1. URL and 2. Tags. Which will do and simulate that visitor to my blod/site comes from TAGS search from google. Thats i wanted to make.
So if my blog is music blog and i would like to get in statistics that visitors comes not direct but from search on google, i type in filed my website tags: “exmple: how ot make xojo app” and htmlviewer will show first the search results and then he go to url ,my blog (this i type in url text field)
Thanks

[quote=80940:@dusan bardy]HTMLViewer1.LoadURL(“https://www.google.lu/search?q=” +TagsField.Text and URLField.Text)

But this doesnt work :([/quote]

Not sure about what you want as result but (TagsField.Text and URLField.Text) is a boolean operation on text fields, and that’s surely not right.

TagsField.Text = “the music”
HTMLViewer1.LoadURL(“https://www.google.lu/search?q=” +TagsField.Text)
// https://www.google.lu/search?q=the music

URLField.Text = “the thing”
HTMLViewer1.LoadURL(“https://www.google.lu/search?q=” +TagsField.Text + ", " + URLField.Text)
// https://www.google.lu/search?q=the music, the thing

TagsField.Text = "the music"
HTMLViewer1.LoadURL("https://www.google.lu/search?q=" + TagsField.Text)
// https://www.google.lu/search?q=the music

URLField.Text = "the thing"
HTMLViewer1.LoadURL("https://www.google.lu/search?q=" +TagsField.Text + ", " + URLField.Text)
// https://www.google.lu/search?q=the music, the thing

woo i will go right now to test it and will tell you :slight_smile:
thank you

It doestn work :frowning:
Ok lets again what i want to make is this following:

1. I type in TagsField.Text my tags i want it search after hit start
2. I type in URLField.Text my final destination url ,after the search tags will be found in HTMLViewer1

SO when i PRESS START/GO button what happes is the HTMLViewer go and search in google the tags I enter in TagsField and once it find and load it in HTMLViewer he go to URL i type in URLField.
that all
thanks for help

My actual code under the StartBtn is this (but not working):

  If TagsField.Text = "" Then
    msgbox("Please Enter Some  Tags")
  End if
  
  If URLField.Text = "" Then
    msgbox("Please Enter Some Valid URL")
  End if
  
  HTMLViewer1.LoadURL("https://www.google.lu/search?q=" +TagsField.Text + ", " + URLField.Text)
  

Try converting your string into a “URLComponent” String like

Dim text as String

text = “https…” + TagsField.Text+", "+URLField.Text and so on

then

text = ConvertEncoding(text, encodings.UTF8)
text = EncodeURLComponent(text)

dim url as string = "http://maps.google.de/maps?hl=de&q="+text+"&ie=UTF-8"

sorry, maps was a code of an app I wrote - principle is the same…

well im just a beginer :frowning: could you exactly write the code what and where to put it please?

no problem…

Dim text, url as String

If TagsField.Text = “” Then
msgbox(“Please Enter Some Tags”)
End if

If URLField.Text = “” Then
msgbox(“Please Enter Some Valid URL”)
End if

text = TagsField.Text + ", " + URLField.Text
text = ConvertEncoding(text, encodings.UTF8)
text = EncodeURLComponent(text)

url = “https://www.google.lu/search?q="+text+"&ie=UTF-8

HTMLViewer1.LoadURL url

Should work

what Rick said is important - have u ever tested the String itself on your browser?

It doesnt load the URLField.Text :frowning: only it load the TagsField.Text (tags in google) then it stays there and not going to url.

"
Christian Jung
is not verified 18 seconds ago Hannover

what Rick said is important - have u ever tested the String itself on your browser?" I dont know what you mean, im just beginer if u could more details.
Thanks

Worked with debugger???

set a breakpoint at HTML Viewer1.LoadURL url
then take a look at the string “url”

copy it and paste it into your browser

if you dont have a result then, its not xojo but your combination of google expression and your variables…

“set a breakpoint at HTML Viewer1.LoadURL url” ?
Sorry i dont know much expressions as i told im beginer :frowning:

If you want help then write what to write exactly to each button.
I just put this code to StartBtn thats all:

  Dim text, url as String
  
  If TagsField.Text = "" Then
    msgbox("Please Enter Some Tags")
  End if
  
  If URLField.Text = "" Then
    msgbox("Please Enter Some Valid URL")
  End if
  
  text = TagsField.Text + ", " + URLField.Text
  text = ConvertEncoding(text, encodings.UTF8)
  text = EncodeURLComponent(text)
  
  url = "https://www.google.lu/search?q="+text+"&ie=UTF-8"
  
  HTMLViewer1.LoadURL url

then i dubugg and i enter tag and url in next field, but it load only google search tags i entered and stayed on that page in htmlviewer, not going to url i enter in urlfield; thats 2 url fields

i tried to put it also in htmlviewer document complete but it doest stay there and refreshing fast the URLField.
but it works.
under startbtn i enter loadurl tagsfield then it load googlesearch + tags but afetr it redirect to the urlfield all ok but as i said it keeps clicking and refreshign very fast, so i want it stay there

can u give ma an example for possible values in Tagfield and urlfield?

MY TAGS WHAT I TYPE IN HERE: TagsField.Text hiphop+blog
MY URL WHAT I TYPE IN HERE: URLField.Text www.bloghiphop.com/

It is only example to tell htmlviewer if pressed StartBtn to load First: TagsField and after google search load with tags SECONDE : go to URLField final destionation. Thank you

Here Picture, thanks


Hbergeur d’images

ok, the first thing you have to get into functionality is the string in the browsers commandline. I assume you won´t get your idea of first and 2nd step in one single browserline flyin…

then you can use that “working string” inside xojo…