DarrenReeder Posted November 19, 2009 Share Posted November 19, 2009 With PHP/MYSQL i have made a form so you can register and it puts your information into the database. I need to make a login box which i think i can half do, I need to use a input box and see if it exist which im pretty sure i can do but i dont know how i set the browser to know that ive logged in, if that makes sense? Also my second question is how do i display data from mysql database onto the screen so its like: Name: 'mysql info' Quote Link to comment https://forums.phpfreaks.com/topic/182160-displaying-information-and-logging-in/ Share on other sites More sharing options...
ram4nd Posted November 19, 2009 Share Posted November 19, 2009 First question: use sessions Second question: You write Name: as string and echo mysql if no right after it Its really easy to google some tutorials about this Quote Link to comment https://forums.phpfreaks.com/topic/182160-displaying-information-and-logging-in/#findComment-961103 Share on other sites More sharing options...
DarrenReeder Posted November 19, 2009 Author Share Posted November 19, 2009 First question: use sessions Second question: You write Name: as string and echo mysql if no right after it Its really easy to google some tutorials about this you answered just as i solved it ...the 'sessions' shall i search on google for 'php/mysql sessions' for some tutorials? i didnt work this bit out Quote Link to comment https://forums.phpfreaks.com/topic/182160-displaying-information-and-logging-in/#findComment-961104 Share on other sites More sharing options...
sKunKbad Posted November 19, 2009 Share Posted November 19, 2009 If you need some examples, you might look at phpclasses.org. Also, if you might use a framework, most frameworks either do this for you, or have user contributions to take care of authentication. Quote Link to comment https://forums.phpfreaks.com/topic/182160-displaying-information-and-logging-in/#findComment-961107 Share on other sites More sharing options...
DarrenReeder Posted November 19, 2009 Author Share Posted November 19, 2009 that site seems to be dead... in need some directions on the path to take to achieve this logged in thingy Quote Link to comment https://forums.phpfreaks.com/topic/182160-displaying-information-and-logging-in/#findComment-961129 Share on other sites More sharing options...
premiso Posted November 19, 2009 Share Posted November 19, 2009 sessions will be the key. Here is a good tutorial on Sessions and cookies, both of which you will probably want to use for a login system. If you get confused or need help with part of the concepts please post here after reading that tutorial above. Quote Link to comment https://forums.phpfreaks.com/topic/182160-displaying-information-and-logging-in/#findComment-961134 Share on other sites More sharing options...
DarrenReeder Posted November 19, 2009 Author Share Posted November 19, 2009 Ive read the introduction to this and i got a few noob questions: (1)What is a header? it is saying "Because the setcookie() function is sending headers" and im not sure what a header is... and actually thats main thing i wanna know so far, im reading rest once i posted this Quote Link to comment https://forums.phpfreaks.com/topic/182160-displaying-information-and-logging-in/#findComment-961465 Share on other sites More sharing options...
premiso Posted November 19, 2009 Share Posted November 19, 2009 As defined by google: In information technology, header refers to supplemental data placed at the beginning of a block of data being stored or transmitted. In data transmission, the data following the header are sometimes called the payload or body. So it is the initial data that is sent to the browser, after data is sent this initial block is locked, so you have to send all your headers before any output is sent to the client, because after that you are on the body of the document, thus it will cause an error. I hope that I explained it correctly, if not anyone can feel free to correct me. Quote Link to comment https://forums.phpfreaks.com/topic/182160-displaying-information-and-logging-in/#findComment-961469 Share on other sites More sharing options...
emopoops Posted November 19, 2009 Share Posted November 19, 2009 all u have to do when the person logs in correctly is take the name from the database that u used to check with the log in and put it into a session variable like this: $_SESSION[theirusername] == $row[usernamefeildindb]; Quote Link to comment https://forums.phpfreaks.com/topic/182160-displaying-information-and-logging-in/#findComment-961473 Share on other sites More sharing options...
FaT3oYCG Posted November 19, 2009 Share Posted November 19, 2009 well you basically want a login script so, Jpmaser77's login script will be exactly what you want. Quote Link to comment https://forums.phpfreaks.com/topic/182160-displaying-information-and-logging-in/#findComment-961482 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.