asdfghjkl Posted June 2, 2006 Share Posted June 2, 2006 hello there , i am a novice programer . I want to make a web page wich is subscribing the users after they've registered them selfs in mysql . ! If noone is understanding the one above then i want to tell to mysql to remember who was registered by signing him automatically in database table like "users" . But i don't know how to do it . Please tell me "how to" do it . [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /] Link to comment https://forums.phpfreaks.com/topic/11053-registering-users/ Share on other sites More sharing options...
jeremywesselman Posted June 3, 2006 Share Posted June 3, 2006 You will need to write a Cookie to the user's browser to hold thier information. And then the next time they come to your site, check for the correct information, and log them in.[!--coloro:#990000--][span style=\"color:#990000\"][!--/coloro--]Jeremy[!--colorc--][/span][!--/colorc--] Link to comment https://forums.phpfreaks.com/topic/11053-registering-users/#findComment-41371 Share on other sites More sharing options...
asdfghjkl Posted June 3, 2006 Author Share Posted June 3, 2006 yeah , but "how to" do it ? Link to comment https://forums.phpfreaks.com/topic/11053-registering-users/#findComment-41409 Share on other sites More sharing options...
Buyocat Posted June 3, 2006 Share Posted June 3, 2006 To log them in make a form that asks for username and password then take the posted data and make a query string something like this:"SELECT * FROM users_table WHERE username=$username AND password=ENCRYPT($password)"then if you have a database connection already you can just @mysql_query($query) and take the return value and, after breaking it apart into something useful, set it to a cookie. Link to comment https://forums.phpfreaks.com/topic/11053-registering-users/#findComment-41530 Share on other sites More sharing options...
asdfghjkl Posted June 3, 2006 Author Share Posted June 3, 2006 "To log them in make a form that asks for username and password then take the posted data and make a query string something like this:"this is with the "select" wich i know already , what about insert into table values can you tell me about that ? Link to comment https://forums.phpfreaks.com/topic/11053-registering-users/#findComment-41568 Share on other sites More sharing options...
Buyocat Posted June 3, 2006 Share Posted June 3, 2006 Well I think it'd help if you elaborated on what exactly you wanted, but to insert user data freshly gathered from a form I would do the following:1. Check that you have what you want (ie it's set and preg matched)2. Strip slash it3. create a query string like: INSERT INTO table_name (row1, row2, row3) VALUES ('val1', 'val2', 'val3');4. run query and then you're finishedhope that helps Link to comment https://forums.phpfreaks.com/topic/11053-registering-users/#findComment-41570 Share on other sites More sharing options...
asdfghjkl Posted June 3, 2006 Author Share Posted June 3, 2006 i've just tryed that and nothing happened , i don't know why i receive only a blank page . are the slashesallways neccesary ? Link to comment https://forums.phpfreaks.com/topic/11053-registering-users/#findComment-41574 Share on other sites More sharing options...
Buyocat Posted June 3, 2006 Share Posted June 3, 2006 Stripping slashes is important because it will protect you from SQL injection. Inserting data to the database shouldn't print anything on screen unless you tell it to, can you use phpMyAdmin or something like that to check and see if the data was entered? If it wasn't then you'll have to give us some more information in order to get further help. Link to comment https://forums.phpfreaks.com/topic/11053-registering-users/#findComment-41586 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.