Loging In With PHPBB
Loging In With PHPBB
Loging In With PHPBB
Loging In With PHPBB
Loging In With PHPBB
Loging In With PHPBB Loging In With PHPBB Loging In With PHPBB Loging In With PHPBB Loging In With PHPBB Loging In With PHPBB Loging In With PHPBB Loging In With PHPBB
Loging In With PHPBB Loging In With PHPBB
Loging In With PHPBB
Go Back  Xtreme Visual Basic Talk > > > Loging In With PHPBB


Reply
 
Thread Tools Display Modes
  #1  
Old 08-08-2005, 06:05 PM
VB6Programmer VB6Programmer is offline
Centurion
 
Join Date: Aug 2003
Posts: 108
Question Loging In With PHPBB


I want to create a program that needs you to login first. I want it take the Username and password from the PHPBB Forums i created so the program should connects to the databse the forums is connecting to and get the username and password. to log them in, how can i do this? i seen someone do it before but i dont remember how they did it.
Reply With Quote
  #2  
Old 08-09-2005, 09:14 AM
wayneph's Avatar
waynephLoging In With PHPBB wayneph is offline
Web Junkie

Retired Moderator
* Expert *
 
Join Date: Apr 2004
Location: D/FW, Texas, USA
Posts: 8,393
Default

Is this application going to be running on the same machine as the forum? If so, you should be able to connect directly to the database, and just query the table.
If not, you're probably going to need to use the HTTPWebRequest object to make a request to the login page on the web server. Then in the response, you'll have to check the HTML for either the successful, or denied message associated from the forum.
__________________
-- wayne, MSSM Retired
> SELECT * FROM users WHERE clue > 0
0 rows returned
Reply With Quote
  #3  
Old 08-09-2005, 01:08 PM
VB6Programmer VB6Programmer is offline
Centurion
 
Join Date: Aug 2003
Posts: 108
Default

The Forum/Database is on the Internet. What i am exactly trying to do is where they start the program it asks for you to login they type the same username and password from the forums. When they connect it take them to a diffrent part of the program. If they have Administrator powers on the Forum they have it on the Program too like editing the text of a section which will be editing is editing a messag of the forum/(table from the database.)
Reply With Quote
  #4  
Old 08-10-2005, 04:18 AM
VB6Programmer VB6Programmer is offline
Centurion
 
Join Date: Aug 2003
Posts: 108
Default

ok will this even be sucure? I was talking with a few people and they said, When you connect to the Sql/Database, it send in the username and passwrod in plain text so you can read the packet it send. So this is not encrypted?
Reply With Quote
  #5  
Old 08-10-2005, 08:58 AM
wayneph's Avatar
waynephLoging In With PHPBB wayneph is offline
Web Junkie

Retired Moderator
* Expert *
 
Join Date: Apr 2004
Location: D/FW, Texas, USA
Posts: 8,393
Default

In my above scenario, you'd be working thorugh the web page, not talking directly to the database. It would have the exact same security as if you were logging into the website. You'd just simulate someone using the form.

When you log into the web page now, you are sending your username and password in clear text.
__________________
-- wayne, MSSM Retired
> SELECT * FROM users WHERE clue > 0
0 rows returned
Reply With Quote
  #6  
Old 08-10-2005, 11:14 PM
VB6Programmer VB6Programmer is offline
Centurion
 
Join Date: Aug 2003
Posts: 108
Default

in the ADOTut txt it talks about some connection which i am thinking is a componet, i cant find it =(
Reply With Quote
  #7  
Old 08-11-2005, 01:18 PM
loquin's Avatar
loquinLoging In With PHPBB loquin is offline
Google Hound

Retired Moderator
* Guru *
 
Join Date: Nov 2001
Location: Arizona, USA
Posts: 12,400
Default

What is the TYPE of database that you are trying to connect? SQL Server? Oracle? MySQL?
__________________
Lou
"I have my standards. They may be low, but I have them!" ~ Bette Middler
"It's a book about a Spanish guy called Manual. You should read it." ~ Dilbert
"To understand recursion, you must first understand recursion." ~ unknown
Reply With Quote
  #8  
Old 08-11-2005, 01:20 PM
VB6Programmer VB6Programmer is offline
Centurion
 
Join Date: Aug 2003
Posts: 108
Default

MySql
Reply With Quote
  #9  
Old 08-11-2005, 01:46 PM
Zumwalt Zumwalt is offline
Contributor
 
Join Date: Sep 2003
Location: Tampa, FL
Posts: 474
Default

Simplify this a little bit to save yourself some time and some headache.
Create a webservice (ASMX) that you can refference, use SOAP, have a function that does the work for you and returns you the results, this way the web service resides on the server.

MySQL supports .NET, they have a little plugin for it that has to be installed on the MySQL server so you can refference it.

Now you just have an application that you have built for them to run on there client, that uses either non-ssl or ssl to send the data back and forth.

Create a login function in your webservice, call this function from your windows forms app locally, don't try to scrape http post/get information, don't even worry about webrequests.

You can build an application that gives them all the functionality you want and run it on there machine calling the webservice which resides on the MySQL server if its the web server, and all the data is just sent via SOAP.

Otherwise, this all sounds like it will end up being a nightmare.
Reply With Quote
  #10  
Old 08-11-2005, 07:40 PM
VB6Programmer VB6Programmer is offline
Centurion
 
Join Date: Aug 2003
Posts: 108
Default

I never done stuff like this before (connecting to MySQL) I dont know what ASMX, SOAP is =(. I might have to get a book one this stuff.
Reply With Quote
  #11  
Old 08-12-2005, 02:49 AM
VB6Programmer VB6Programmer is offline
Centurion
 
Join Date: Aug 2003
Posts: 108
Default

...?
Reply With Quote
  #12  
Old 08-12-2005, 08:16 AM
wayneph's Avatar
waynephLoging In With PHPBB wayneph is offline
Web Junkie

Retired Moderator
* Expert *
 
Join Date: Apr 2004
Location: D/FW, Texas, USA
Posts: 8,393
Default

Quote:
Originally Posted by VB6Programmer
...?
You didn't ask a question. Are you looking for confirmation that you need to buy a book?
__________________
-- wayne, MSSM Retired
> SELECT * FROM users WHERE clue > 0
0 rows returned
Reply With Quote
  #13  
Old 08-12-2005, 01:05 PM
Zumwalt Zumwalt is offline
Contributor
 
Join Date: Sep 2003
Location: Tampa, FL
Posts: 474
Default

Books are great, I have my own personal library, my wife calls me a book worm hog, she already told me if we lost electricicty for an entire winter, we have enough programming books to keep us warm by the fire for the entire 4 months.

That said, maybe you should start alot simpler than what your trying to tackle if you have never worked with MySQL / SOAP or .NET Web Services.

Taking what you initially requested:
Quote:
I want to create a program that needs you to login first. I want it take the Username and password from the PHPBB Forums i created so the program should connects to the databse the forums is connecting to and get the username and password. to log them in, how can i do this? i seen someone do it before but i dont remember how they did it.
Breaking it down into sections as to what you are asking:
Login Form --> you want this to be something on the users local PC, that talks across the web, to a MySQL server (presuming its running IIS with the PHP plugin)

So, I am presuming this is your first step (only step here so far requested)

I am assuming you know how to connect, on the IIS Server Running PHPBB, the PHPBB to the MySQL database using a database connection command.

To do this, from a remote PC, as a windows application, you have to consider the following rules.

1) Does the server have more than port 80 open? (as in the MySQL direct port, is it also open? *note, bad mojo*)
2) What operating system is the client going to be using connecting your application back to the server?
3) What do you want to do once you connect?

Since we can presume you are the web programmer creating this remote application, you can assume that atleast the very least, port 80 is available.

So now, what technology would be useful to talk across port 80 to accomplish a remote application?

Since you posted this in the .NET section of the VB forums, I am presuming VB.NET of some flavor.

(Resource for MYSQL by the way: www.mysql.com, click on the developer zone tab, familiarize yourself with the different plugins.)

(Resource for webservice from msdn and asp.net: http://msdn.microsoft.com/library/de...sp02222001.asp)

(Resource for connecting to webservice from vb.net or c#.net: http://msdn.microsoft.com/library/de...lStudioNET.asp)

Now what does all this really mean?
You create a webservice on the web server that does the same thing that the PHPBB login stuff does, except the output is not back to the browser instead it is transported back to your windows client application with the exact same results.

The difference is the syntax in the PHP code is very different than that of the asmx page, and that of the client application.

Your public "login method" for your webservice will need to have within it, the connection information to the MySQL database, then you will need to have it return a result, in this request, you seem to just want to know if it was successful or not, so you can return a string and pass "Success" back.

An example, short one:
Code:
Imports System.Web.Services
Imports MySql.Data

<WebService(Namespace:="http://tempuri.org/")> _
Public Class Service1
    Inherits System.Web.Services.WebService

    <WebMethod()> Public Function CheckLogin(ByVal UserName As String, ByVal Password As String) As String
        Dim dbResult As String
        If UserName <> "" And Password <> "" Then
            'code here to login and get results
            'set dbResult to record count or something
            Dim myConnectionString As String

            myConnectionString = "server=127.0.0.1;" _
                        & "uid=" & UserName & ";" _
                        & "pwd=" & Password & ";" _
                        & "database=test;"

            Try
                Dim conn As New MySql.Data.MySqlClient.MySqlConnection(myConnectionString)
                conn.Open()
                CheckLogin = "Success"
                conn.Close()

            Catch ex As MySql.Data.MySqlClient.MySqlException
                Select Case ex.Number
                    Case 0
                        CheckLogin = "Cannot connect to server. Contact administrator"
                    Case 1045
                        CheckLogin = "Invalid username/password, please try again"
                End Select
            End Try
        End If
    End Function

End Class
(untested code, trying to show you how it looks, took and modified the instructions from the MySQL website to fit example)

Now as you can probably guess, once you invoke this webservice method, your result will be 1 of 3 things based on the results.

There is still more to this, much more than I should probably be typing, including creating a windows application project in vb.net, adding a web refference pointing to the asmx that this resides in, followed up by creating a function, that in turn uses the call to the webmethod in this example of chech login.

There is also much more, in regards to serializtion of the information and encryption depending and adding a 3'rd check paramater so that you have a key pair that you send from your client that the webmethod can check so that not anyone can use your webservice and guess until they get a successful result.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Loging In With PHPBB
Loging In With PHPBB
Loging In With PHPBB Loging In With PHPBB
Loging In With PHPBB
Loging In With PHPBB
Loging In With PHPBB Loging In With PHPBB Loging In With PHPBB Loging In With PHPBB Loging In With PHPBB Loging In With PHPBB Loging In With PHPBB
Loging In With PHPBB
Loging In With PHPBB
 
Loging In With PHPBB
Loging In With PHPBB
 
-->