View Full Version : Can someone Show me?

08-31-2009, 01:10 AM
I wish to know how to make a page to create accounts on your website.
and how to make it so someone can pay online for a product

08-31-2009, 01:18 AM
you want to start by looking at sessions/cookies and databases.

08-31-2009, 01:35 AM

Im Good with mySql..
i hosted a world of warcraft private server for a while :) (shhhh"!)
i am great with html
and CSS

But I SUCK With PhP so im starting out with something difficult to try and get better..

But i'm familiar with how to set what settings and stuff for the database

like the


and i know how to run queries just not that great with making them

08-31-2009, 02:42 AM
Well basically you'd have a table, which stores all the account details so things like:
userid (primarykey)
pass (got to encrypt this somehow)

etc......would be your table fields (some people may split this into 2 tables, just have userid, username and pass as one table then all the little details in a seperate table with the userid linking them.)

Then you create a registration page which allows for entry of these fields, and then insert them into the database when somebody submits a correct form(remember to validate for bad entries).

Then for a login form you just check the users user and pass match one that exists in the database and if so then they can be logged in (just create a session variable called logged in or something and check for it on every page which requires authorisation)

That's the basic thinking behind it, you have to put it into practice!

You need to know all about forms and using PHP with forms (obtaining/sanatizing form input) so go through tutorials if you've not really messed around with this. (Basic PHP)

Then you need to learn all about PHP/MySQL interaction, mainly queries (insert, update, delete) etc...
Here is where I learnt that part: http://www.tizag.com/mysqlTutorial/

i'm not too sure about payments as it requires all sorts of security, so be careful, you may need to use some sort of CMS or a pre-coded solution, as it's a sensitive area.

Phil Jackson
08-31-2009, 09:38 AM
Take a look at the info provided above. Make a start. When you get to the point of hair pulling, post your code here :-)

08-31-2009, 11:47 PM

$username = $_POST['username'];
$password = $_POST['password'];

echo "$_POST['username'] has been logged in!";



<h4>Account Page</h4>
<form action="login.php" method="post">
Username: <input type="text" size="10" maxlength="40" name="username"> <br />
Password: <input type="password" size="10" maxlength="10" name="password">

<input type="submit" />

And the Database is

accounts << accounts << Rows= (userid, username, password, country, gender ip, dob)

I dont understand this very well

09-01-2009, 12:13 AM
So what is your code for login.php?

09-02-2009, 01:01 AM

$username = $_POST['username'];
$password = $_POST['password'];

echo "$_POST['username'] has been logged in!";


thats the login.php code