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
  • 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 The Helper:
    Happy Thursday!
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top