Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New Coder
    Join Date
    Aug 2009
    Posts
    21
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Can someone Show me?

    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

  • #2
    New Coder
    Join Date
    Jul 2009
    Location
    UK
    Posts
    89
    Thanks
    5
    Thanked 11 Times in 11 Posts
    I'd love to change the world, but they wont give me the source code.

  • #3
    New Coder
    Join Date
    Aug 2009
    Posts
    21
    Thanks
    1
    Thanked 0 Times in 0 Posts
    well...

    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

    $user="root"
    $pass="admin"
    $dbname="accounts"

    and i know how to run queries just not that great with making them
    Last edited by jdfskitz; 08-31-2009 at 02:11 AM.

  • #4
    Regular Coder
    Join Date
    Apr 2008
    Posts
    685
    Thanks
    15
    Thanked 105 Times in 104 Posts
    Well basically you'd have a table, which stores all the account details so things like:
    userid (primarykey)
    username
    pass (got to encrypt this somehow)
    country
    ip
    gender
    dob


    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.
    Last edited by Scriptet; 08-31-2009 at 02:46 AM.

  • #5
    Senior Coder
    Join Date
    Aug 2009
    Location
    Mansfield, Nottinghamshire, UK
    Posts
    1,555
    Thanks
    57
    Thanked 148 Times in 147 Posts
    Take a look at the info provided above. Make a start. When you get to the point of hair pulling, post your code here :-)

  • #6
    New Coder
    Join Date
    Aug 2009
    Posts
    21
    Thanks
    1
    Thanked 0 Times in 0 Posts
    login.php

    <html><body>
    <?php
    $username = $_POST['username'];
    $password = $_POST['password'];

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

    ?>

    </body></html>
    <html><body>
    <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" />
    </form>
    </body></html>
    And the Database is

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


    I dont understand this very well
    Last edited by jdfskitz; 09-02-2009 at 01:01 AM.

  • #7
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    So what is your code for login.php?
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #8
    New Coder
    Join Date
    Aug 2009
    Posts
    21
    Thanks
    1
    Thanked 0 Times in 0 Posts
    srry

    <html><body>
    <?php
    $username = $_POST['username'];
    $password = $_POST['password'];

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

    ?>
    thats the login.php code


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •