This Forum has been archived there is no more new posts or threads ... use this link to report any abusive content
==> Report abusive content in this page <==
Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
mysql and php codes for database help?simple sign up form?
02-21-2014, 11:22 PM
Post: #1
mysql and php codes for database help?simple sign up form?
I need to make a project like a sign up form and it updates my database(I'm using xampp).I already made an html form.What should I do with the form action(after clicking 'submit')? My teacher said it has something to do with cookies but I don't really get how cookies function.Can you tell me the step by step process to make a sign up form like facebook?(except there's no email add confirmation)
What should happen is :
1. welcome page
2.sign up/register form (data entered should be stored in database using mysql_update())
3. log in using the data entered in the previous form
4. access the website as a member not a guest
5. log out

Please help me >.<
I need help with the codes especially regarding cookies and number 4.

Ads

Find all posts by this user
Quote this message in a reply
02-21-2014, 11:31 PM
Post: #2
 
There are a million ways to do this and the answer would be much too large to post on YA. There are thousands of examples of this on the internet--do some Googling. While this task does seem a little complicated, it's not that hard if you break it down into smaller tasks.

1. One page is the welcome page (index.php).
2. One page is the signup page (signup.php).
3. One page is the login form (login.php).
4. Modify the pages to your website to check if you're logged in.
5. One page is the logout page (logout.php).
6. Create a database with a Users table. Store the id, username, password, email address, signup date (and any other fields).

W3Schools has some pretty good PHP tutorials:
http://www.w3schools.com/php/
http://www.w3schools.com/php/php_mysql_intro.asp

Also, do not use the standard mysql_ functions--you need to use mysqli_ functions. Standard mysql_ functions have been deprecated in PHP 5.5 and will be removed in future versions of PHP. You'll notice the W3Schools PHP/MySQL tutorials use mysqli.

Ads

Find all posts by this user
Quote this message in a reply
02-21-2014, 11:46 PM
Post: #3
 
As Arnold said, it's a pretty long process. But there are many word tutorials for it on the web, just google it!

As for 1)
That's pretty easy to create, just make a register link in it.
2) Create a register.php with a form, and what the hell is mysql_update? You need to use mysql_query();
3) create a login.php page and select the data from the users table where the user data (username/pass) got inserted and compare it with the login data.
4) If the login data is correct create a session: $_SESSION[];
5) destroy the session to log out.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)