New Website (database help)

bobby5589

Member
Reaction score
15
Well, im makeing a new website. I have html down and the layout set up pretty much. What I really need to know is how to put a login on the web pages. I know how to do the form in html, but id like to have it were after you log in some personaly settings show on the pages, such as your avi or other personal info like posts and maybe forum stats. :banghead:

Ill be using phpBB and MySQL.

I have two samples on ripway for now so you can see what the layout looks like.(& no, its not a ripway website, theyre just samples)

http://h1.ripway.com/bobby5589/TestPages/5589Home.html
http://h1.ripway.com/bobby5589/TestPages/5589test-MMO-GPotato.html

For those who help I thank you.
 

mase

____ ___ ____ __
Reaction score
154

undeadorcjerk

The Ulitimate TheHelper.net Lurker
Reaction score
223
we already know of that place, there were we learned about it.
 

bobby5589

Member
Reaction score
15
yes, i know that and i read those. Mostly i was asking for some help cause i was a little confused. :banghead:

Ok, for example I would use
Code:
<html>
<body><form action="welcome.php" method="post">
Name: <input type="text" name="name" />
Age: <input type="text" name="age" />
<input type="submit" />
</form></body>
</html>
to make a form, but i'd what i should replace welcome.php with if im useing phpBB. Also after they log in, how would i get info bout the person that loged in and have it show on all the pages they visit on the site that theyre loged in?
 

mase

____ ___ ____ __
Reaction score
154
You would have to go into the phpBB tables in your database and get that user's info.

You would a query like this: "SELECT * FROM *TABLE* WHERE username=".*USER*
 

bobby5589

Member
Reaction score
15
um, that gives me an idea. Could i do it like this?

After they enter the username & password in the form, it checks to see if the two match and if they do, that create a session cookie containin the data from the database. Then when a page is viewed and finds the session cookie it loads the varibale data from it. And when ever the person clicks some button to logout the session is ended.

Idk, if i could do that, but its an idea.
 

DDRtists

ɹoʇɐɹǝpoɯ ɹǝdns
Reaction score
415
Login.php:
See updated post below...

Logout.php:
PHP:
<?php

session_start();
session_unset();
session_destroy(); 

?>

Of course, you would have to modify the first one with the info of your table, ect ect.
 

bobby5589

Member
Reaction score
15
thats more like the kind of help I was looking for. Now one more question, how would i put that in html or do i change it to .php? Also could you explain what i replace the red with?
 

mase

____ ___ ____ __
Reaction score
154
You don't change the red, only the login and password if neccesary. And you would have to change it to .php
 

bobby5589

Member
Reaction score
15
No, phpBB doesnt have SSI. Iv worked with phpBB alone before, but i havent installed it on my site as of yet so ill look at SMF.


Ok, i looked at SMF. I dont like it, but i do think i got how to do this now. Ill try my idea tmr and post how it goes.
Thx for all the help, expesially to DDRtists for the code. ;)
 

enouwee

Non ex transverso sed deorsum
Reaction score
240
Login.php:
PHP:
$query = 'SELECT * FROM accounts WHERE login = "'.$_POST['user'].'" AND

You never heard the words SQL INJECTION, did you? How can you even dare putting such a thing when you know that it could be reused in some website?

exploits_of_a_mom.png


EDIT: what makes things worse, is that you are actually a moderator in this part of the forum!
 

DDRtists

ɹoʇɐɹǝpoɯ ɹǝdns
Reaction score
415
Well, for my last post in this thread, I'm sorry for posting that code without the stuff to protect against Injection attacks. I took it from my script, and the checks for that stuff were in the middle of my MySQL login stuff, and I didn't really see them there.

However, be sure to check out the function:
http://us2.php.net/mysql_escape_string
For more info on how to protect your MySQL queries from Attacks.

My apologies. :)
 

bobby5589

Member
Reaction score
15
well, thx anyways DDRtists. You dont need to worry bout me doing anything, but i cant say the same for those who look at thread. +rep to you & mase
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top