Help (Get text from .php website) [solved]

Posts 1–15 of 20 · Page 1 of 2
Help (Get text from .php website) [solved]
Im trying to make a program that grabs the TRUE or FALSE fom a site and then tells my program which it is and the program will either have a text box or like a different picture.
heres what i have so far.
http://i.imgur.com/qYwW5.pngⓘ
its just the webbrowser loading the PHP page and showing the text, but i want the program to know which it says (true or false) and then show a certain text box or show a certain picture
thanks
[highlight=vb.net]
Dim useable As Boolean = False
Using wClient As New Net.WebClient()
useable = wClient.DownloadString("http:/rwebsite").ToLower().Contains("true")
End Using
[/highlight]
Quote Originally Posted by Jason View Post
[highlight=vb.net]
Dim useable As Boolean = False
Using wClient As New Net.WebClient()
useable = wClient.DownloadString("http:/rwebsite").ToLower().Contains("true")
End Using
[/highlight]
Wow thanks, ill try some thinks


@Jason
how do i use it, its abit confusing
Quote Originally Posted by BassSR View Post

Wow thanks, ill try some thinks


@Jason
how do i use it, its abit confusing
What's confusing? You put the php link in where i put "http:/rwebsite", the webclient downloads the pagesource from there, checks whether it contains "true". the "useable" variable now tells you whether the page said true or false

[highlight=vb.net]
Dim useable As Boolean = False
Using wClient As New Net.WebClient()
useable = wClient.DownloadString("http:/rwebsite").ToLower().Contains("true")
End Using
If Not useable Then 'the pagesource didn't contain "true"
MessageBox.Show("This is unuseable")
Else
MessageBox.Show("This is useable!")
End if
[/highlight]
Quote Originally Posted by Jason View Post


What's confusing? You put the php link in where i put "http:/rwebsite", the webclient downloads the pagesource from there, checks whether it contains "true". the "useable" variable now tells you whether the page said true or false

[highlight=vb.net]
Dim useable As Boolean = False
Using wClient As New Net.WebClient()
useable = wClient.DownloadString("http:/rwebsite").ToLower().Contains("true")
End Using
If Not useable Then 'the pagesource didn't contain "true"
MessageBox.Show("This is unuseable")
Else
MessageBox.Show("This is useable!")
End if
[/highlight]
So you doing like Uni now?
is it for coding still or is that jsut a hobby?
you knew me as apex of ap exh aks :3

your a fucking boss VB coder i swear
Thanks man
Yeah I am doing Uni.

Thread marked solved.
Nice, grats on it
ok when i do it, i want to mkae the images visiable and invisable
whic i did like this:
Code:
  If Not useable Then 'the pagesource didn't contain "true"
            PictureBox1.Visible = True & PictureBox2.Visible = False & PictureBox3.Visible = False
        Else
            PictureBox2.Visible = True & PictureBox1.Visible = False & PictureBox3.Visible = False
        End If
dosnt seem to work tho
Quote Originally Posted by BassSR View Post
Nice, grats on it
ok when i do it, i want to mkae the images visiable and invisable
whic i did like this:
Code:
  If Not useable Then 'the pagesource didn't contain "true"
            PictureBox1.Visible = True & PictureBox2.Visible = False & PictureBox3.Visible = False
        Else
            PictureBox2.Visible = True & PictureBox1.Visible = False & PictureBox3.Visible = False
        End If
dosnt seem to work tho
You can't just link lines together like that

[highlight=vb.net]
PictureBox1.Visible = useable
PictureBox2.Visible = useable
PictureBox3.Visible = useable
[/highlight]
Code:
  Dim useable As Boolean = False
        Using wClient As New Net.WebClient()
            useable = wClient.DownloadString("************").ToLower().Contains("FALSE")
        End Using
        If Not useable Then 'the pagesource didn't contain "true"
            PictureBox1.Visible = True
            PictureBox2.Visible = False
        Else
            PictureBox1.Visible = False
            PictureBox2.Visible = True
        End If
dosnt work.
wont change images on change of the text on the site
Quote Originally Posted by BassSR View Post
Code:
  Dim useable As Boolean = False
        Using wClient As New Net.WebClient()
            useable = wClient.DownloadString("************").ToLower().Contains("FALSE")
        End Using
        If Not useable Then 'the pagesource didn't contain "true"
            PictureBox1.Visible = True
            PictureBox2.Visible = False
        Else
            PictureBox1.Visible = False
            PictureBox2.Visible = True
        End If
dosnt work.
wont change images on change of the text on the site
Because the parsed result of your php doesn't contains the string 'FALSE'.
Quote Originally Posted by BassSR View Post
...
wClient.DownloadString("************").ToLower().Contains("FALSE")
...
I bolded the parts you should pay attention to.
Outside link removed. Next time you post one I have to report it.

And the reason it's not working is because that page is broken:

[highlight=php]
Parse error: syntax error, unexpected $end, expecting T_VARIABLE or T_DOLLAR_OPEN_CURLY_BRACES or T_CURLY_OPEN in ***********.php on line 4
[/highlight]

AND BECAUSE you converted the string "ToLower()", then checked if it contained "FALSE" which is in uppercase lol, of course that's going to fail.
the only words there are true or false
Quote Originally Posted by BassSR View Post
the only words there are true or false
Not when I visited the link: There was a PHP error. Try this and see what happens

[highlight=vb.net]
Using wClient As New Net.WebClient()
MessageBox.Show(wClient.DownloadString("********** **").ToLower())
End Using
[/highlight]
i screwed up but the only text there is either true or false
Posts 1–15 of 20 · Page 1 of 2

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us