Jump to content

Recommended Posts

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

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

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

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 it
3. create a query string like: INSERT INTO table_name (row1, row2, row3) VALUES ('val1', 'val2', 'val3');
4. run query and then you're finished

hope that helps
Link to comment
https://forums.phpfreaks.com/topic/11053-registering-users/#findComment-41570
Share on other sites

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.