Notices

Overclockers Forums > Software > Programming Tips and Tricks
Programming Tips and Tricks
Forum Jump

msg board in vb6

Post Reply New Thread Subscribe Search this Thread
 
 
Thread Tools
Old 08-23-02, 01:12 AM Thread Starter   #1
AltecXP
Member

 
AltecXP's Avatar 

Join Date: Jul 2002

 
msg board in vb6


to make my own msg board should i use vb6 j++ or c++? or a mix?
AltecXP is offline   QUOTE Thanks
Old 08-23-02, 02:52 AM   #2
XWRed1
Senior Member

 
XWRed1's Avatar 

Join Date: Oct 2001

 
I suppose you could use j++ or c++ if you were going to do it via cgi, but you wouldn't use vb6.

C++ is a bit too low level for a messageboard, you'd spend more time worring about the language than the board, I think. Java would be good I guess, if a little unconventional. Visual J++ is obsolete.
XWRed1 is offline   QUOTE Thanks
Old 08-25-02, 01:02 AM   #3
jwhitehorn
Member

 
jwhitehorn's Avatar 

Join Date: Aug 2002
Location: Jonesboro, Arkansas

 
To make a message board, you will more than likly want to code in CGI. That being said, CGI can be any language. First thing you need to think of is, "What system will be the web server for my message board?". If its your own system, then you will probably be running the OS of your choice, and could have the CGI in the language of your choice. If its someone elses system, like a service providers systems, then you will need to check to see what language you should use to code for your CGI. Most service providers systems are Unix/Linux based, and would therefor work best with Perl CGI.

If its your own system, ask yourself "What languages do i already know?". If you do not already know C++, i would learn it anyway. C++ is an excellent language to program anything in because of its OO status. Java is OO also, but you do not have the nice option of Inheritence, in which one Class can get certain characteristics from a Parent Class. This makes it nice if you want to have maybe a message board with different rooms (like this forum), so they could get certain characteristics from the main message board. Also C++, because of its ability to have Classes, allows you to reuse code many times in many different program.

To code CGI in C++, all you have to do is have your C++ program output HTML to the screen, and have your HTML webpage access to program as a link. Its a little more complex than that, but that is the basics of it.

Hope this helps
jwhitehorn is offline   QUOTE Thanks
Old 08-25-02, 06:48 PM Thread Starter   #4
AltecXP
Member

 
AltecXP's Avatar 

Join Date: Jul 2002

 
thanx i've been trying to learn c++ in my spare time anyway
AltecXP is offline   QUOTE Thanks
Old 08-27-02, 02:25 PM   #5
skip
OCForums Founder & Extraordinarily Elusive Administrator

 
skip's Avatar 

Join Date: Nov 2000
Location: Chicago, IL

10 Year Badge
 
VB does CGI very will with the right functions.

__________________
Born to be Wild!!
skip is offline   QUOTE Thanks
Old 08-27-02, 02:40 PM   #6
Cowboy Shane
Member



Join Date: Jan 2002
Location: Augusta, GA

10 Year Badge
 
Quote:
Originally posted by jwhitehorn
...C++ is an excellent language to program anything in because of its OO status. Java is OO also, but you do not have the nice option of Inheritence, in which one Class can get certain characteristics from a Parent Class. This makes it nice if you want to have maybe a message board with different rooms (like this forum), so they could get certain characteristics from the main message board. Also C++, because of its ability to have Classes, allows you to reuse code many times in many different program.
Since when did Java not support inheritence? Perhaps you meant multiple inheritence, but that would not really be what you described above. Java has the exact same benefits you ascribed to c++. i don't know that either would be a good fit for creating a forum, but hey, go for it.
Cowboy Shane is offline   QUOTE Thanks
Old 08-27-02, 05:14 PM   #7
XWRed1
Senior Member

 
XWRed1's Avatar 

Join Date: Oct 2001

 
Quote:
Originally posted by skip
VB does CGI very will with the right functions.
But you'd be giving up all the VBness, like drawing your own gui, no?
XWRed1 is offline   QUOTE Thanks
Old 08-27-02, 05:47 PM   #8
skip
OCForums Founder & Extraordinarily Elusive Administrator

 
skip's Avatar 

Join Date: Nov 2000
Location: Chicago, IL

10 Year Badge
 
Nope.

The Old classifieds we used here were done in VB. VB does not only use a GUI. You can certainly do non-gui VB and send poure HTML to the Web Browser.

__________________
Born to be Wild!!
skip is offline   QUOTE Thanks
Old 08-27-02, 05:51 PM   #9
skip
OCForums Founder & Extraordinarily Elusive Administrator

 
skip's Avatar 

Join Date: Nov 2000
Location: Chicago, IL

10 Year Badge
 
Here's a little Cut and Paste of some of the old Classifieds code:

===================================

Code:
strCOName = "dbconnection1"
strWSName = "ws1"
strCOConnect = "ODBC;DATABASE=" & DBName & ";UID=" & DBLName & ";PWD=" & DBPass & ";DSN=" & DSName
Set WS = CreateWorkspace(strWSName, "Admin", "", dbUseODBC)
Set co = WS.OpenConnection(strCOName, dbDriverNoPrompt, False, strCOConnect)
Set rs = co.OpenRecordset(strSQL, dbOpenDynaset, dbRunAsync, dbOptimistic)
Do While rs.StillExecuting
Loop
strSQL = ""

End Sub

Public Sub Cgi_Main()

On Error GoTo ERH

Dim Bp(1 To 11) As String
Dim Bu(1 To 11) As String
Dim Ct(25) As String
Dim Bur As String

Dim j As Integer
Dim g As Integer
Dim q As Integer

Dim d As Date

j = 1
Do
    Ct(j) = ReadINI("Cats", "Cat" & (j))
    If InStr(1, Ct(j), "'") Then
        Ct(j) = Replace(Ct(j), "'", "`", 1, -1, vbTextCompare)
    End If
    If Ct(j) = "" Then
        j = j - 1
        Exit Do
    End If
     j = j + 1
Loop

nFileNum = FreeFile
Open App.Path & "\header.txt" For Input As nFileNum
        Input #nFileNum, PgHead
Close nFileNum

If UseB = True Then
    Bur = ReadINI("Banners", "Bup")
    If Right(Bur, 1) <> "/" Then
        Bur = Bur & "/"
    End If
    g = 1
    Do
        Bp(g) = ReadINI("Banners", "Bpic" & (g))
        Bu(g) = ReadINI("Banners", "Burl" & (g))
        If Bp(g) = "" Then
            g = g - 1
            Exit Do
        End If
        g = g + 1
    Loop
    Dim i As Integer
End If
    
' Check Action Requested

Action = UCase(GetCgiValue("Action"))

Select Case (Action)
    Case "NEWITEM"
        SendHeader
        Send "<HTML><HEAD><TITLE>Classified Ads/32 - Professional - Get Password</TITLE></HEAD>"
        Send "<body bgcolor=" & Chr(34) & clr & Chr(34) & "><font size=""2"" face=""verdana,arial,helvetica"">"
        Send "<p>&nbsp;<br>"
        Send "<center><h2>Enter Your Classified Ads Login.</h2></center><br>"
        Send "<center><h3>You must have a verified account to place Ads on this system</h3></center>"
        Send "<center><b>Click " & "<a href=" & a & cPath & "?action=CreateLogin" & a & ">" & "<b>HERE</b></a> to Create your account</center>"
        Send "<center><b>Click " & "<a href=" & a & cPath & "?action=CASENDPASS" & a & ">" & "<b>HERE</b></a> if you forgot your Password</center>"
        Send "<form action=" & a & cPath & "?Action=AddNewItem" & a & " method=""Post""><br>"
        Send "<center><h3>Enter the <font Color=""Red"">Email Address</font> you are registered with.</h3></center><br>"
        Send "<center><input type=""text"" name=""em"" size=""20""><br><br>"
        Send "<center><h3>Enter Your Classified Ads Password.</h3></center><br>"
        Send "<center><input type=""password"" name=""pw"" size=""8""><br><br>"
        Send "<input type=""submit"" name=""submit"" value=""Login""></center>"
        SendFooter
        Send "</font></body></html>"
    Case "ADDNEWITEM"
            Dim pwid As String
            Dim eml As String
            pwid = GetCgiValue("pw")
            eml = GetCgiValue("em")
            strSQL = "SELECT * FROM Users WHERE passwd = '" & pwid & "'" & " AND Email = '" & eml & "'"
            Connect_DB strSQL
        If rs.EOF Then
            SendHeader
            Send "<html><head><title>ClassAds/32-Professional - Enter New Add</title></head><body bgcolor=" & Chr(34) & clr & Chr(34) & ">"
            Send "<basefont size=""2"" face=""verdana,arial,helvetica"">"
            Send "<center><h1>Login Information is not Correct!!</h1></center>"
            Send "<center><p>If you have forgotten your password, Send Email to: <a href=""Mailto:" & sEmail & Chr(34) & ">" & sEmail & "</a>"
            Send "<center><p>If you have not created an account yet, Click the <font color=""red"">Create Account</font> link at the bottom of the page!"
            SendFooter
            Send "</font></body></html>"
        Else
        If rs("Locked") = "N" Then
            If UCase(pwid) = UCase(rs("Passwd")) Then
                SendHeader
                Send "<html><head><title>ClassAds/32-Professional - Enter New Add</title></head><body bgcolor=" & Chr(34) & clr & Chr(34) & ">"
                Send "<basefont size=""2"" face=""verdana,arial,helvetica"">"
                Send "<center><h1>Enter New Classified Ad</h1></center>"
                Send "<center><table cellspacing=""0"" cellpadding=""0""><tr><td><p><b><font color=""red"" size=""+1"">TERMS AND CONDITIONS:</font></td></tr>"
                Send "<tr><td><b>- Ads placed on this system will expire in <font size=""+1"" color=""red"">" & Xpire & "</font><font size=""+1""> Days</b></font></td></tr>"
                Send "<tr><td><b>- IP addresses are recorded for every Ad Placed. Yours is: <font color=""red"">" & CGI_RemoteHost & "</font></b></td></tr>"
                Send "<tr><td><b>-<font color=""red""> " & SysName & "</font> reserves the right to delete ANY Ad that we feel is not apropriate! </b></td></tr>"
                Send "<tr><td><b>-<font color=""red""> " & SysName & "</font> will not be held liable for any transactions made through these Ads! </b></td></tr>"
                Send "<tr><td><b>-<font color=""red""> " & SysName & "</font> All HTML will be stripped from Ads! </b></td></tr></table></center>"
                Send "<form method=post action=" & a & cPath & "?Action=ADD"">"
                Send "<input type=""hidden"" name=""password"" value=" & rs("passwd") & ">"
                Send "<input type=""hidden"" name=""UID"" value=" & rs("User_ID") & ">"
                Send "<input type=""hidden"" name=""UNAME"" value=" & rs("User_Name") & ">"
                Send "<input type=""hidden"" name=""UEMAIL"" value=" & rs("Email") & ">"
                Send "<center><table cellspacing=""1"" border=""0""><tr><td align=""right"">Category:</td><td><SELECT name=""Category"">"
                For q = 1 To j
                    Send "<option>" & Ct(q)
                Next q
                Send "</select></td></tr>"
                Send "<b><tr><td align=""right"">Item:</td><td><input name=""Item"" size=""35"" maxlength=""100""></td></tr>"
                Send "<tr><td align=""right"">Your Phone:</td><td><input name=""Phone"" size=""35"" maxlength=""12""></td></tr>"
                Send "<tr><td align=""right"">Item Price: " & CurSym & "</td><td><b></b><input name=""Price"" size=""35"" maxlength=""20""></td></tr>"
                Send "</b></table><br>"
                Send "<b>Item Description:</b><br><textarea name=""Desc"" cols=65 rows=5 wrap=on></textarea><br>"
                Send "<p><b><font size=""+1"">By posting this Ad you agree to the above terms and conditions</font></b><br><br>"
                Send "<input type=submit value=""I Agree - Place Ad"">&nbsp;&nbsp;<b><a href=" & a & hPath & a & ">I Don't Agree - Leave" & "</a>" & "</b><br></form>"
                Send "</font></body></html>"
                SendFooter
            Else
                SendHeader
                Send "<html><head><title>ClassAds/32-Professional - Enter New Add</title></head><body bgcolor=" & Chr(34) & clr & Chr(34) & ">"
                Send "<basefont size=""2"" face=""verdana,arial,helvetica"">"
                Send "<center><h1>Bad Password!</h1></center>"
                Send "<center><p>If you have forgotten your password, Send Email to: <a href=""Mailto:" & sEmail & Chr(34) & ">" & sEmail & "</a>"
                SendFooter
                Send "</font></body></html>"
            End If
        Else
            SendHeader
            Send "<html><head><title>ClassAds/32-Professional - Enter New Add</title></head><body bgcolor=" & Chr(34) & clr & Chr(34) & ">"
            Send "<basefont size=""2"" face=""verdana,arial,helvetica"">"
            Send "<center><h1>Sorry, Your Account is Locked for a rules violation!</h1></center>"
            Send "<center><p>If you think this is an error, Send Email to: <a href=""Mailto:" & sEmail & Chr(34) & ">" & sEmail & "</a>"
            SendFooter
            Send "</font></body></html>"
        End If
            
    End If
    Close_DB

__________________
Born to be Wild!!
skip is offline   QUOTE Thanks
Old 08-27-02, 10:29 PM   #10
XWRed1
Senior Member

 
XWRed1's Avatar 

Join Date: Oct 2001

 
So I could still draw out the GUI for the forum in VB and have it generate proper HTML or whatever. Thats pretty slick.



Or maybe you meant to respond 'yes'. So then why use VB at all? Because it is BASIC and it has some OO features and can use ActiveX controls?
XWRed1 is offline   QUOTE Thanks

Post Reply New Thread Subscribe


Overclockers Forums > Software > Programming Tips and Tricks
Programming Tips and Tricks
Forum Jump

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Mobile Skin
All times are GMT -5. The time now is 04:19 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
You can add these icons by updating your profile information to include your Heatware ID, Benching Profile ID or your Folding/SETI profile ID. Edit your profile!
X

Welcome to Overclockers.com

Create your username to jump into the discussion!

New members like you have made this the best community on the Internet since 1998!


(4 digit year)

Why Join Us?

  • Share experience
  • Max out your hardware
  • Best forum members anywhere
  • Customized forum experience

Already a member?