Added: 3 years ago
From: phpacademy
Views: 306,455
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:
see all

All Comments (695)

Sign In or Sign Up now to post a comment!
  • Every one it seems that the first time i tyied this i didn't work but i was using wamp so i tried it on my website, my website host is Cixx6.com so putting the login/register system on my site worked so for all you people if you are using it on wamp and it don't work try upload the system to your site and it might work.

  • Comment removed

  • Where do you save all your files?

  • what i would like to no is there away if someone has a registered with us,that they can delete there account,so they dont have to email me to take them off the database? just saves me from going into phpadmin and deleting the user ,if so what script would i attach for this thanks

  • Comment removed

  • @ActiveBassDestroyer (my previous reply was cut off :|) You would probably want to pass the user's ID or username via a variable (so it's available also on delete.php) and then add this code to delete.php:

    $delete = mysql_query("DELETE FROM phplogin WHERE username='" . $_SESSION['username'] . "'"); //Replace $_SESSION['username'] with the variable that stores username

    ;)

  • One tip: If you want MySQL to get up and going fast download easyphp. Easyphp configures the basic stuff and you'll have myphpadmin ready to go

  • is it possible to use db4free?

  • What is POST?

  • @bumrang there is POST and GET, POST sends information using a separate package and GET uses the URL

  • Comment removed

  • sorry, I did not understand enything... :/

  • I wrote the username and password wrong, but does not appear to me a message

  • is this system safe? or easy to break?

    plz reply

  • @sultneulven Pretty easy, since sessions aren't that hard to crack because they have some security gaps. If you want to plug them, you will need some advanced coding.

  • @sultneulven it 80% safe

  • Oh God, You didnt finish it yet, you should write SQLquery to check whether the username and password exist or not in user table!

  • got a error saying " Parse error: syntax error, unexpected '}' in C:\xampp\htdocs\My_Login\login­.php on line 13 does anyone know how to fix it

  • i use picwizz.com - free image hosting with no limits

  • Your videos suck you don't explain stuff enough

  • @madtriksmadtriks You're just a moron. 

  • when i try to go to login.php file it goes to blank page.. did everything as you but still couldnt go to the same page as u did... i got localhost and all but still nothing.. pls help??

  • Comment removed

  • What can I use instead of mysql_select_db ?

  • @smoketest123

    mysqli_connect('host', 'user', 'password', 'DATABASE');

  • If i type mysql_select_db it doesent work on my 000webhost server!! Why? :(

  • @smoketest123 you need to use the php myadmin on 000webhost and use the details from that. also, did you upload all the files you need?

  • you know what i hate,

    when i spend forver looking over these stupid tutorials

    and they don't work.

    IT downloads the fucking login.php when i type it in or click log in...

    i've looked it over for 2 hrs now, thanks PHPacademy

  • @Sikeman214 dude did you set up xammp aor wammp server?

  • @FashSolanki yes, i have XAMMP.

  • @Sikeman214 can u tell me your problem in detail. this tut worked for me.

  • I've looked OVER EVERYTHING.

    I do not get that connect error when i refresh my login.php!!!! PLEASE HELP!

  • Comment removed

  • Just a couple things I wanted to point out:

    - The inputs and breaks don't have end tags.

    - You probably should use char data types instead of varchar in this case, so your table has fixed-length records. It takes marginally more space, and SIGNIFICANTLY speeds up searches.

    - You don't have a uniqueness constraint on username, which you probably want.

  • Good tutorial, keep going!

  • Brill tutorial man !!!

  • ein wirklich gutes Tutorial :D

  • hello I've done one thing wrong i think But i cant find what.. Please add me skype ScapePkz

  • thank you , its very helpful

  • I double checked all my scripting but I still get the couldn't connect error. How can I fix that?

  • man,you rock!!!

    We need people like YOU!!! Keep the great tutorials up!!!

    THANK YOU!!!

  • great tutorial

  • Sir alex...it's great & you are the best tutor

  • i get these error messages when i register user login

    Notice: Undefined index: submit in C:\xampp\htdocs\register.php on line 5

    Notice: Undefined index: fullname in C:\xampp\htdocs\register.php on line 7

    Notice: Undefined index: username in C:\xampp\htdocs\register.php on line 8

    Notice: Undefined index: password in C:\xampp\htdocs\register.php on line 9

    Notice: Undefined index: repeatpassword in C:\xampp\htdocs\register.php on line 10 please advise how to define those index in my register.php

  • @trinitymet777 put error_reporting(E_ALL&~E_NOTIC­E); at the top of your script just after <?php

  • Thank you so much!

  • Hi can you upload the code please!

  • why are people watching this when they don't know html...?

  • @ItsVicc It's called sarcasm.

  • 99 most useful codecanyon premium script for webdeveloper: youtube.com/watch?v=1bMbJww_A3­g

    Thumbs up if you like it.

  • Parse error: syntax error, unexpected T_STRING in C:\xampp\htdocs\Project\login.­php on line 10

    my line 10 is "mysql_select_db("phplogin") or die("couldnt find db");"

  • cool tutorial

    i hope i get good at this

  • Couldn't find db

    

  • i think OR DIE function dosent work anymore ?

  • My PHP files open as plain text. Can anyone help me with this? Thanks

  • @smokenfly514 gotta make sure the filetype is .php, the easiest way to check this is to look and see if the page says localhost/login.php.txt or something like that

  • @sith4life It is .php though :( Do you have any other suggestions? Thanks

  • the main mistake most tutorial given they just guide us for writing coding only without showing the software setting and we are the beginner headache to find the error or compare the source code while unable to running the program ... PLEASE TAKE NOT ON THIS ISSUES FOR WHO WANT TO GIVE TUTORIAL .. but very appreciate for tutorial given....

    what i'm facing here problem with database connection and find out that i didn't thick allow url include from PHP setting... GOOD tutorial.. thanks ya

  • Very good so far, got this to work easily enough. You're very good at this/

  • Good Tutorials, but you have to have a bit knowledge in computers and stuff to do this, and I'm already familiar with C++, so this is going good, for now!

    Thanks again!

  • nice

  • when i login it says:

    Parse error: syntax error, unexpected T_STRING in login.php

  • @phpacademy when i click "log in" it just downloads my login.php file :S :S :S

    helpppppepepepepep

  • @blakeyou91 PHP files can only be ran inside of a server, me i use a fake server like "IIS" for this, at first it will get you a error but you gotta install some stuff for it to work, you will find more on the internet. Just search that error on google :P

  • @blakeyou91 what do you mean it just downloads your login.php file

  • @dust103194 Hi, i fixed it now (kindof) i had my index file set as index.html so nothing was happening, but once i changed to PhP it was fine

    however now.. i press login and it says error syntax T_STRING on line 11

    so do you know what that problem is? i typed exactly whats on this video

  • @blakeyou91 PM me on youtube your full login.php code and ill take a look

  • I am using XAMPP and it does not require a password

  • What is HTML?

  • @text2121 hyper text markup language

  • @text2121 for making websites and stuff, like, layout of a page and adding images and all that

  • @text2121 Well if you want the literal definition HTML stands for...hypertext management language.

  • @studioslime Actually it's HyperText Markup Language

  • @HakuTheUmbreon WOW...I can't believe I said that...yeah your right, I have know idea why i said management. (Derp)

  • @text2121 please tell me you're joking..

  • @text2121 it is a graveyard!!

  • @text2121 And it means Hyper Text Markup Language.

  • @text2121 Hyper Text Markup language = HTML! ... in laymans terms... HTML is a language in which the browser (Internet Explorer, Firefox, Opera, Safari, Chrome..) can understand and the browser interprets HTML coding to show you web pages in your PC neatly..

  • Comment removed

  • Good video

  • database in version 3.4.5 is different could you make a new video of how that one is done? on members area is a total different layout

  • @ActiveBassDestroyer on the main it has in appearance settings settings theres a setting called "theme/style" if you change that to original you have the same layout as he does on video

  • database in version 3.4.5 is different could you help me to set up the members area or make a vidoe of the new one?

  • love the pace of the tutorial

  • template ? on youtube channel ?

  • just so you know:

    I added some of your movies on my blog

    You do a great job!

    I advertise for you;)

    cssstylecodes.blogg.no

  • Comment removed

  • I'm having a problem with this tutorial.

    I have been doing exactly like the uploader has done. I have checked it atleast 5 times and checked every little letter to make sure it's right.

    But, everytime i'm trying to log in without a username and password, the page is going blank for me. Anyone know a solution?

  • @Zaila1337 I have the same problem except when I hit the log in button it actually outputs my script from the login.php

  • @aReason4music same here bro :/

  • @Zaila1337 that is what he says at the end: 9:13

  • @Zaila1337 I had this same problem after extensive research and headache I found out that, you must set a password for your phpMyAdmin. Once you have done that in every line of in the mysql_connect function you need to put your password into the parameters, in the 3rd set of quotation marks. Example: $connect = mysql_connect("localhost","roo­t","ENTER YOUR PASSWORD HERE");

  • Finally Did Part 1 Great Job!

  • Hi I have used your login in my website I have used #session_start when I login and go to member area it ask me to login again

  • it wont open my php files even after i save them to the xampp folders

  • html valid "" - !''

  • As I was just scratching my head on how to write this user login system, I search your videos and find this, thank you so much

  • my submit button doesn't do anything?

  • Mysql connects to a SQL DB And Mysql_connect Goes to a Sqli DB

  • btw, what is the difference between mysql_connect() and mysqli_connect() ?

  • I have no Idea what kind of server you are using but, IIS 7.5 can't see index.php that starts with -html- and ends with -/html- , and if you change the extension to .html or .htm , the php script just doesn't work. Also POST method returns error 405. phpinfof() works, so php is instaled and mysql is also installed, php-mysql connection is working because i tested it.

  • great man.. if i would be a PHP programmer someday..  its all because of your tutorials man.. :) keepitup.. your virtual student from Philippines :) sorry for my english :)

  • thanks,

    i needed this but i was affraid to get a 12 year old spitting in his mic and telling me to copy some code. I found this actually helpfull :D

    THANKS

  • I have set mine up exactly like in the video. However, my form is accepting any username and password as a success, even if they aren't in my db.

    I have after the 2 statements in the if block, echo $USERNAME, and no matter what I put in - it does this. never gets to the else statement.

    What can I be doing wrong cause the server, user, pass and db are correct?

  • @bluesrocker1991

    $username = $_POST['username'];

    $password = $_POST['password'];

    if ($username&&$password)

    { $connect = mysql_connect("localhost","roo­t","") or die ("Couldn't connect!"); mysql_select_db("phplogin") or die ("Couldn't find db"); } else die("Please enter a username and password");

    Make sure your code looks like this.

  • Comment removed

  • Source code please man !!

  • thanks, mate

  • could u upload source code, PLSSSS :))

  • You should use mysqli_connect();

  • n1 man

    :)

  • I did all of this, and I still keep getting the error message "please enter a username and a password". Can anyone tell me why?

  • shitcode.

    pls use PDO and dont use die in future

  • Parse error: syntax error, unexpected T_STRING in C:\xampp\htdocs\login.php on line 9

    WTF! does not work!

  • @theodor70941 Yo - dude - check that you have all your ; at the end of variables and ' in the right place. I had the same problem - fixed those and it worked again.

  • Really well done, straight forward instructions at a good speed!

  • this is my problem after i click the button log in

    Notice: Undefined index: username in C:\xampp\htdocs\sitea\login.ph­p on line 2

    Notice: Undefined index: password in C:\xampp\htdocs\sitea\login.ph­p on line 3

    Please Enter a username and a password

    ___________________

    plsss help me

  • @keepr0ck

    : ( don working

    ?????????????

  • @keepr0ck Either turn off error reporting or state the variable before mentioning it since that error really isn't an error but a notice.

  • @aaron1a12 it works already

  • Comment removed

  • @keepr0ck seems like you may have forgotten the name="username" and name="password" in the index.php file or the name is not spelled the same (it is case sensitive)

  • @keepr0ck You need to define the $username and $password variables first.

  • i have defined username and password

  • @keepr0ck

    $username = ""; if(isset($_POST['username']))  $username = $_POST['username'];

    try something like that

  • @keepr0ck Make sure you have the text input name the same as

    $username = $_POST['TEXTBOX NAME'];

    $password = $_POST['TEXTBOX NAME'];

    Remember its case sensitive.

  • good

  • after login in this message shows

    Notice: Undefined index: username in C:\xampp\htdocs\sitea\login.ph­­p on line 11

    Notice: Undefined index: password in C:\xampp\htdocs\sitea\login.ph­­p on line 12

    Please Enter a username and a password

    ------------------------------­­--------------

    pls help me fix this..thanks a lot

  • shit!!!

  • thumbs up!

  • Noch Probleme mit XAMPP, PHP, HTML, CSS, CMS-Systemen, DynDNS oder so? Schau mal vorbei:  my first server .tk

    is aber noch ganz neu :)

  • "lets call it php noo *backspace* phplogin" lol thanks for the vids :D really helped me out

  • Hey Adam! Tnx for your vid tutorials. Can you help me in my Thesis? PLEASE help me in my Online Ordering Website for a Mobile Store. Looking Forward for your reply. cuteprince_ian17@yahoo.com

  • it wont show the user text field?

  • FUCK GOOGLE'S ADS

  • what about security??!!

  • @45miya security isn't important at this very moment.

  • I typed everything right, I even triple checked it, but I keep getting the "please enter a username and a password". What am I doing wrong?

  • Your a hero to me.

    You're brilliant, genius. woooooooooooow

  • Notice: Undefined index: password in C:\xampp\htdocs\loginphp\login­.php on line 4

    my line: $password = $_POST['password'];

    whats wrong?

  • Hi Alex,,I just Wanna Ask..What Php Book Will You Recommend Us ?

  • @vancruel27 I'm not alex, but i would recommend PHP5 Power Programming

  • @vancruel27 why buying a book when u have his channel to learn from?

  • Sort of reminds me of Harry Potter

  • the voice and accent reminds me of Moss from IT crowd :)

  • Im confused on how to get pgpMyAdmin I went to the website and downloaded the

    phpMyAdmin-3.4.3.2-all-languag­es.7z

    I opened it and all I see is a bunch of files now what?

  • What order should I watch these videos in?

  • Comment removed

  • You're from the north, aren't you?

  • After watching parts 1-4 (great tutorials BTW), I have everything working except that when I click the link to go to the member page, I get the message "You must be logged in!" instead of the welcome message. Any suggestions?

  • Ah darn. I need somebody's help! I did exactly what the video says, but it does't show the error message. Instead, it shows the entire login.php ..... What to do?!

  • Great job, lot's of help!

  • it just show me a blank page , no error message even when i dont insert username and password... what the problem..

  • I keep getting this error, any help?

    Notice: Undefined index: username in C:\xampp\htdocs\login.php on line 26

    Notice: Undefined index: password in C:\xampp\htdocs\login.php on line 27

    Incorrect password

  • @Unstoppablebuffetguy same question here

  • @rishum1000 i don't know if someone already answer this, but this isn't a error, is a notice, php is just let you know that you haven't declare the variable username, or if you're using $_REQUEST, $_POST, $_GET, is saying that you haven't declared the array value called for example $_POST["username"]

  • @5t4rl1n thanks i deleted my old acouunt and yes no one ansered this question thanks again

    rishum1000(now 100)

  • @rishum100 oh ok, then is working fine?

  • @5t4rl1n yes it is

  • @CovexCinem It is only if you page is host by localhost. It means that you variable isn't set. But it should be work.

    If you have other question, pn me.

  • Notice: Undefined index: username in C:\xampp\htdocs\WEBSITE\templa­tes\Processing\Login.php on line 3

    Notice: Undefined index: password in C:\xampp\htdocs\WEBSITE\templa­tes\Processing\Login.php on line 4

  • Webcom Technologies

  • i think i have wrote all the code rigth but it use the die on db "culden´t conect to db"

    i dont have a username on the server i think and if i have were can i find it

  • to view this code i open my dreamweaver, just past on code

  • YOU ARE AMAZING

    

  • @phpacademy can u post a template for us?