CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    Join Date
    Apr 2012
    Posts
    12

    Question Relaying information from PHP Script/MySQL

    Don't know what this forums like, hoping it's as friendly as some of the forums i've come across, but hey i'm Kyle
    Right, I'm going to explain into as much detail as possible what I want to achieve here...

    I Have VB6.0 Pro Edition, I Have multiple sites, one of which is what I'm needing help with.

    I run an internet radio station (http://www.kt-radio.co.cc/). I Have a specific server for each of
    a) Front end website (Public)
    b) DJ Panel, which is where the staff login and fetch notices, requests, messages, pm's etc.

    I basically want to relay different parts of the website (all written in php with a MySQL Database) into a VB executable so DJ's can download it and use the DJ Panel without a browser as it can get frustrating.

    Different features I want to include are;

    - Login (Using the existing login's)
    - Message Box
    - Set DJ Message
    - SHOUTcast Server Status
    - Staff Chat (Basically a shoutbox)
    - Notifications (Haven't got this feature)

    All of the above, Barr the notifications already exist on a website.

    I Can Message you with any ftp login or URLS you might need.
    I Have a limited knowledge with stuff like this, i can build simple VB apps, and write simple PHP, but bringing them both together :shoot:.

    PM Me if you'd rather help through E-Mail or BlackBerry Messenger.


    Thankyou!

    Kyle
    Last edited by KT-Radio; April 14th, 2012 at 07:20 PM. Reason: Me being a tool and not reading the T&C's Properly.

  2. #2
    Join Date
    Apr 2012
    Posts
    12

    Re: Relaying information from PHP Script/MySQL

    P.S: I'm hopeless with chaging messing with MySQL. Installed it with a base script and built ontop of it (Bit of a Cheat )

  3. #3
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Relaying information from PHP Script/MySQL

    Anything posted here will be picked up by bots by Monday, so I'd remove it NOW, and hope they haven't picked up on it. We can PM you, only with a current USER ID!
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  4. #4
    Join Date
    Apr 2012
    Posts
    12

    Re: Relaying information from PHP Script/MySQL

    ahh sorry about that, I'm on it.

  5. #5
    Join Date
    Apr 2012
    Posts
    12

    Re: Relaying information from PHP Script/MySQL

    Don't suppose you'd be able to help out on this dglienna...?

  6. #6
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Relaying information from PHP Script/MySQL

    Not really. I'd suggest starting with VB.Net or VS2010 and C#. While VB6 might be able to cobble together various band-aids and scripts, I'd scrap the idea of using VB6.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  7. #7
    Join Date
    Apr 2012
    Posts
    12

    Re: Relaying information from PHP Script/MySQL

    Ah right, downloaded vb2010 last night, havent had chance to play around with it yet though... bit scared of eveni installing C# never even thought about learning it.

    Thanks

  8. #8
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Relaying information from PHP Script/MySQL

    Might be easier if you are GOOD at VB6, as it's a bit different. If not, then VB.Net is the way to learn...
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  9. #9
    Join Date
    Apr 2012
    Posts
    12

    Re: Relaying information from PHP Script/MySQL

    Wouldn't say I'm "Good" as such.. But I have 'above limited knowledge' . And I have a bit of an expansion to what I was asking that might make it easier to interpret..
    <?php
    $ip = "IP ADDRESS HERE";
    $port = "PORT";
    $fp = @fsockopen($ip,$port,$errno,$errstr,1);
    if (!$fp) {
    $title = "Connection timed out or the server is offline ";
    } else {
    fputs($fp, "GET /7.html HTTP/1.0\r\nUser-Agent: Mozilla\r\n\r\n");
    while (!feof($fp)) {
    $info = fgets($fp);
    }
    $info = str_replace('</body></html>', "", $info);
    $split = explode(',', $info);
    if (empty($split[6])) {
    $title = "No song is currently playing ";
    } else {
    $count = count($split);
    $i = "6";
    while($i<=$count) {
    if ($i > 6) {
    $title .= ", " . $split[$i];
    } else {
    $title .= $split[$i];
    }
    $i++;
    }
    }
    }
    $title = substr($title, 0, -2);
    print $title;
    ?>
    Thats what I wasnt to relay to the VB project, with alot of other code of a similar format. I just don't know what to view it with.

    EDIT: I know I need a reader of sorts, but I have never had to deal with a MySQL query with vb before, Only time I edit MySQL querys is when I am writing it in notepad for php. The output of this query, in PHP will display in text, is their a way I can feed that text through to a label of sorts? Need it as a variable really but I don't have a clue :-#
    Last edited by KT-Radio; April 17th, 2012 at 04:31 PM. Reason: Taken IP and Port info out

  10. #10
    Join Date
    Jul 2006
    Location
    Germany
    Posts
    3,725

    Re: Relaying information from PHP Script/MySQL

    Still I don't quite understand what you want to achieve.
    Do you want to rewrite the above code to VB6?
    Or do you want a variable in VB which holds the above program code? Or the output of it?

  11. #11
    Join Date
    Apr 2012
    Posts
    12

    Thumbs up Re: Relaying information from PHP Script/MySQL

    Quote Originally Posted by WoF View Post
    Still I don't quite understand what you want to achieve.
    Do you want to rewrite the above code to VB6?
    Or do you want a variable in VB which holds the above program code? Or the output of it?
    I'll try have another shot at it lol.
    'SHOUTcast DNAS Stats' are hosted on a seperate webserver (Not owned by me).
    I Have the PHP code for these stats, which relay the stats to my DJ Panel.
    I Want the stats from shoutcast dnas, to relay into the VB app (Somehow...)

    I can't upload anything as the file limit is quiet small. So I can't upload a screenshot of the stats.

    The code i posted in the previous post is the the "Song now Playing" stat.
    If someone could tell me how to use this PHP code in VB I would greatly appreciate it!

    And thankyou for getting back to me mate

    EDIT:
    Do you want to rewrite the above code to VB6?
    I think this could be what I want to achieve yes, but what component would I use?
    Thanks

  12. #12
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Relaying information from PHP Script/MySQL

    Depends on the browser, and/or the language you use...
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  13. #13
    Join Date
    Apr 2012
    Posts
    12

    Re: Relaying information from PHP Script/MySQL

    Quote Originally Posted by dglienna View Post
    Depends on the browser, and/or the language you use...
    My project supports FireFox and Internet Explorer. 2 different forms for each, when you load the project, it asks you which one you want to use, and their the most popular for people tuning in

    Thanks

    EDIT: I want to try and stay away from the internet tools though, I have so many problems with them both:/
    Last edited by KT-Radio; April 19th, 2012 at 02:19 AM.

  14. #14
    Join Date
    Jul 2006
    Location
    Germany
    Posts
    3,725

    Re: Relaying information from PHP Script/MySQL

    Many things you do in this PHP script are to be done more complicated in VB6, but I think all in all everything could be converted to pure VB6 code.

    As I understood you want a stand-alone application which is NOT a webbrowser.
    Otherwise, VB6 has a WebBrowser control which might be capable to run PHP, although I have to admit my experience with this control is rather limited.

  15. #15
    Join Date
    Apr 2012
    Posts
    12

    Talking Re: Relaying information from PHP Script/MySQL

    Quote Originally Posted by WoF View Post
    Many things you do in this PHP script are to be done more complicated in VB6, but I think all in all everything could be converted to pure VB6 code.

    As I understood you want a stand-alone application which is NOT a webbrowser.
    Otherwise, VB6 has a WebBrowser control which might be capable to run PHP, although I have to admit my experience with this control is rather limited.


    Yeah It would be alot better to do it in code than using the WebBrowser control as, In my oppinion, it is crap.
    If you could point me in the right direction on how to convert it to vb6 code, or how to convert it into Visual studio 2010 code,I would be much greatful.
    I sat up for hours last night trying to work it out, but had no luck.

    Cheers

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured