PHP & mysql: registration script part 1

Post your own tutorial to features you made or questions frequently asked

PHP & mysql: registration script part 1

Postby DaBomb1022 » Tue Mar 09, 2010 4:31 am

I am going to make a few tutorials on php. I will start out with login and register systems then branch out to guestbooks, forums, or blogs. All these php tutorials will be for iwebkit (duh). This is part 1 because most things you do in php (besides guestbooks) require logging in and registering. Lets start out by setting up the mysql database. All the code that I show you goes in the <div id=content> tag.

Setting up the database
To setup the database you need to have phpmyadmin. If you are using a local webserver it is probably located at http://localhost/phpmyadmin or if you have a web host check your cpanel. Open up php my admin and you should see a box that says "create a new database". type "mysite" as the name of it and press enter. If you want to use a different name you can. For now just make a table called "users" and put number of fields at 3, this table will obviously store the users data. Now in the field boxes put in "id", "username", "userpass" without quotes. Mysql is case sensitive so don't capitalize anything. Under Type keep int for the id and change username and userpass to varchar. This means id is a number and the other two can be numbers or characters mixed. We are almost done! set the id to auto increment or A_I towards the bottom and give id a length of 10. Set username and userpass to a length of 40. before clicking go view this picture to see if you have it right:
http://i776.photobucket.com/albums/yy43/zackster10/db.png


The last thing to do for part 1 is make the register page. All this page will do is submit the data to another page, maybe called registerme.php and that will insert it into the database.
register.php
Code: Select all
<form action="registerme.php" method="post">
      <span class="graytitle">Register</span>
<ul class="pageitem">
<li class="textbox">Please register for my site!</li>
         <li class="bigfield"><input name="user" placeholder="Username" type="text" /></li>
         <li class="bigfield">
         <input name ="pass" placeholder="Password" type="password" /></li>
            <li class="bigfield">
         <input name ="pass2" placeholder="Re-enter Pass" type="password" /></li>
            </form>
            </ul>

All i did here was use some form elements from iwebkit. I will soon make the next tutorial. If you need any more help ask here.
Need help? I'm new way better than when I started with PHP, check out my development team.
Hire me and see my stuff
DaBomb1022
Addict
Addict
 
Posts: 484
Joined: Fri Jul 17, 2009 9:50 am

Re: PHP & mysql: registration script part 1

Postby DaBomb1022 » Fri Mar 12, 2010 3:46 am

Does anyone want me to continue this tutorial?
Need help? I'm new way better than when I started with PHP, check out my development team.
Hire me and see my stuff
DaBomb1022
Addict
Addict
 
Posts: 484
Joined: Fri Jul 17, 2009 9:50 am

Re: PHP & mysql: registration script part 1

Postby Christopher » Fri Mar 12, 2010 1:15 pm

I would like to learn somebasic php rules, you know. like this line does this :p

could you write something on that? thanks if you do :)
please search before posting!
User avatar
Christopher
Site Admin
Site Admin
 
Posts: 1154
Joined: Thu Dec 11, 2008 12:01 am
Location: France

Re: PHP & mysql: registration script part 1

Postby DaBomb1022 » Fri Mar 12, 2010 4:17 pm

Okay I will try
Need help? I'm new way better than when I started with PHP, check out my development team.
Hire me and see my stuff
DaBomb1022
Addict
Addict
 
Posts: 484
Joined: Fri Jul 17, 2009 9:50 am

Re: PHP & mysql: registration script part 1

Postby JamesRW » Fri Mar 12, 2010 4:20 pm

I recently learned PHP - my first language (not counting HTML/CSS) since BASIC back in the 1980s! It was really easy and it has really opened up a lot of new possibilities for my websites. I wish I had learned it a lot sooner. I have not learned the PHP/MySQL stuff yet. I can fiddle around in the admin panel and not screw things up but creating something from scratch is over my head. Right now I'm working on learning JavaScript - and having a much harder time with it than PHP! After that I'll be jumping in to databases and from your post it looks like something I think I'll be able to handle - or you're just a good teacher!
JamesRW
Amateur
Amateur
 
Posts: 18
Joined: Fri Mar 12, 2010 7:56 am

Re: PHP & mysql: registration script part 1

Postby DaBomb1022 » Sat Mar 13, 2010 12:02 am

Thanks a lot. And I agree php was mostly easy but javascript is harder
Need help? I'm new way better than when I started with PHP, check out my development team.
Hire me and see my stuff
DaBomb1022
Addict
Addict
 
Posts: 484
Joined: Fri Jul 17, 2009 9:50 am

Re: PHP & mysql: registration script part 1

Postby djrich » Mon Mar 22, 2010 5:33 pm

i am looking ofr a reg script for iwebkit with php PLEASE post how to do it:)
i prefer without mysql just to make it easier if u know??
thank u
djrich
Fan
Fan
 
Posts: 84
Joined: Sat Feb 13, 2010 7:33 pm

Re: PHP & mysql: registration script part 1

Postby DaBomb1022 » Fri Apr 02, 2010 5:04 am

There are a LOT of those tutorials, here is a good video that helped me. http://www.youtube.com/watch?v=4oSCuEtxRK8
Sorry for the late response. If you send me a tweet on twitter I would reply much faster
Need help? I'm new way better than when I started with PHP, check out my development team.
Hire me and see my stuff
DaBomb1022
Addict
Addict
 
Posts: 484
Joined: Fri Jul 17, 2009 9:50 am

Re: PHP & mysql: registration script part 1

Postby Vincewinb » Sat Apr 03, 2010 7:49 pm

Please continue on this login and register script.. I need it :)
I love pixels.
User avatar
Vincewinb
Aficionado
Aficionado
 
Posts: 176
Joined: Sun Feb 14, 2010 12:50 pm

Re: PHP & mysql: registration script part 1

Postby DaBomb1022 » Sat Apr 03, 2010 10:53 pm

I will within the week hopefully but I'm busy with iblog 1.1 and once I'm done I will continue. For now watch that video ^^
Need help? I'm new way better than when I started with PHP, check out my development team.
Hire me and see my stuff
DaBomb1022
Addict
Addict
 
Posts: 484
Joined: Fri Jul 17, 2009 9:50 am

Next

Return to Your tutorials

Who is online

Users browsing this forum: No registered users and 1 guest