Added: 2 years ago
From: phpacademy
Views: 66,669
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:
see all

All Comments (162)

Sign In or Sign Up now to post a comment!
  • Parse error: syntax error, unexpected ')' in C:\xampp\htdocs\register.php on line 12

  • Why not use the die function when passwords do not match? By using echo won't the code still run?

  • Comment removed

  • how to change the echo error msg from top to bottom ?

  • How do you put the strlen function, if MD5 can convert every text you submit into the it's length of codes

  • dm i hv fixed:P

  • pls help i have the method set to post on form but its still not posting ???

  • could u give me the code for registration page pls

  • So... I can't help but notice that you never had the username checked to see if it was taken. yeah...

  • BEST tutorial EVER!!!!! thanks alot!!!!

  • i'm a php beginner, but i cand see that you are making the decision for password lenth, with them encrypted ....

    :))

    even though you're making a great tutorial!

  • I don't know how to thank you. Because you learned me php

  • I'm about to smash my head onto my desk... line 41 error again. I remove the brace and the error remains. What on earth is going on?

  • Slow down please.....

  • i have always a error in else!

    please help meeeeeeeee

  • @TheLoLGameplays7312

    I had the same problem, it means there is an else where there shouldn't be an else. Usually a { bracket is the problem. So if you've done

    if() { if(){

    } else {

    if() {

    }

    }else

    You need to remove the bracket just after the else as you see there's 4 bracket's opening the statement and only 3 closing them. You need an equal amount.

  • Parse error: syntax error, unexpected T_ELSE in on line 28

  • You do it REALLY fast...

  • Guys, if you have questions - just join the forum.

  • 06:00 better try

    input name="username" type="text" maxlength="25"

    in html :-p

  • omg, please help. when i dont you this code:

    if (isset($_POST['submit']) && $_POST['submit']){

    }

    i get unexpected index errors on line 5, 8, 9, 10, and 11 but when i use it i get a wierd unidentified variable error on line 16 but on it its only a { and i got a ending }. its really wierd cause i did exactly as phpacademy did

    please help me

  • md5 decryption is possible. The safest think to use it a salt like this:

    $password = md5(strip_tags($_POST['passwor­d + $salt']));

    $salt = 's+(_a*';

    Or something like this:

    $salt = 's+(_a*';

    $password = md5(strip_tags($_POST['$salt + password + $salt']));

  • @BiohazardElements woops thats a little off try this :D

    $username = strip_tags($_POST['username'])­;

    $password = strip_tags($_POST['password'])­;

    $keyname = strip_tags($_POST['keyhloderna­me']);

    $email = strip_tags($_POST['email']);

    $password2 = strip_tags($_POST['password2']­);

    $salt = 's+(_a*';

    if($submit){

    //check for other same usernames if($username&&$password&&$pass­word2&&$email){ $password = md5($password+$salt); $password2 = md5($password2+$salt);

  • @BiohazardElements hi. may i ask, what does this salt do?

  • @joeldelumen salt ads a generated code to the md5 hash and it makes it harder for a hacker to get the password, when a user signs up it ad's a string to their password and then runs md5.

  • After filling all fields in the form also I am getting same error

    asking me to

    please fill in all fields

    so please help me

  • Just realized on every single login and register tutorial everybody keeps posting the same problem.

    If you get Undefined variable, be sure to put "@" beside the variable

    example

    @$fullname = strip_tags($_POST['fullname'])­;

  • Comment removed

  • Comment removed

  • Comment removed

  • With the md5 password, instead of doing that, just do this - if ($fullname&&$username&&$_POST[­'password']&&$_POST['repeatpas­sword']&&$age&&$location) .

  • Hey Alex. How's it going? I got just a question for you... When I define my $submit variable by the the assignment of the value $_POST['submit'], undefined index comes up! :| I'd decided to escape that error by adding @ at the beggining of the sentence.

  • @tutorialesnet For everybody who's having these errors, use this code instead:

    $submit = strip_tags(isset($_POST['submi­t']));

    $username = strip_tags(isset($_POST['usern­ame']));

    $password = strip_tags(isset($_POST['passw­ord']));

    $repeatpassword = strip_tags(isset($_POST['repea­tpassword']));

  • @Ayzhong Thanks alot dude :

  • what a waste of time, it can be done in around 3 minutes, wtf, it took you 1 hour to explain it.

  • cant see my echo lol?

  • Notice: Undefined variable: submit in D:\wamp

    please help to resolve this error

  • Notice: Undefined variable: submit in D:\wamp

  • Suas aula são muito confusas.......quem vê esse tipo de video aula esta querendo aprender e não ficar mais confuso.

  • There is problem about checking password characters ti need to bi like if (strlen($password)>70||strlen(­$password)<2) { echo "Parola çok küçük veya çok büyük!"; } else { $password = md5($password); $repeatpassword = md5($repeatpassword); }

  • that password is always going to be 32 after the md5....

  • What does "Notice: Undefined variable: submit in C:\xampp\htdocs\jonzy\register­.php on line 18" mean. When i first go to the register.php page that eror goes up. Some one please help

  • @kwonzomatic i would think that means you have a variable $submit that you didn't give a value to

  • @jimjimmy1995 its alright...i already figured out how to fix it with someone elses comment on here...thanks anyways

  • @kwonzomatic This will fix the undefined variable problems:

    $submit = strip_tags(isset($_POST['submi­t']));

    $username = strip_tags(isset($_POST['usern­ame']));

    $password = strip_tags(isset($_POST['passw­ord']));

    $repeatpassword = strip_tags(isset($_POST['repea­tpassword']));

  • Comment removed

  • Comment removed

  • @kwonzomatic He is using an old PHP, I think PHP4.

    You need to put your code in this:

    if($_POST['submit'])

    {

    if($_POST['username'] !== '' etc)

    {

    }

    }

  • Comment removed

  • @kwonzomatic place:

    error_reporting (E_ALL ^ E_NOTICE);

    in your top php block

  • @kwonzomatic you can "escape" this error by doing following code:

    if(isset($_POST['submit'])

    Basically you now are going to check if that post-variable is set.

  • checking the username lenght would be much easier to do in html with maxlength="20"

  • @daeheadshot Yes, however it's not about ease, it's more about protecting the database from user-generated errors. maxlength is a client-side "protection", so-to-speak. The MySQL limit is a minimum version of a server-side protection.

  • For those who are having problem with call reference error:

    Plz go to the "php" then --> "php settings" that is in the xampp or wamp server (i'm using it) and check the "allowc call time pass reference". And you'll be facing no error. I've tried it!

  • as ninjafoxinteractive you could just write maxlength in the tag like this

    input type='text' name=' before

    input type='text' name='fullname' maxlength=25  after

    save yourself time from writing a whole bunch of if statements >.>"

  • Comment removed

  • I'm getting errors which I thought had been resolved from part 2 but they seem to be appearing again after testing for "please fill in all fields" section.

    These are the error messages I am getting are about unidentified index. any help?

  • merci bien 

  • Mate, you can also set the Maxlength = 25 in the input tag

    so that you don't have to go through a lot of effort trying IF it.

  • Comment removed

  • hey can you please post the code i messed up somehere and cant get it to work :(

  • Dude, learn to salt your entries! ARGH! Your going to get hacked by anyone that owns an md5 dictionary. Also your not encrypting, your hashing! Learn your stuff dude!

  • Dude, learn to salt your entries! ARGH! Your going to get hacked by anyone that owns an md5 dictionary.

  • you can use "now()" rather than using $date = date("Y-m-d");

  • you can you "now()" rather than using $date = date("Y-m-d");

  • Comment removed

  • Great tutorials as always. Congrats and thank you.

  • its a bit annoying you keep saying that md5 is encryption, its not.. Its hashing

  • @DjonnxNeller Oh no!

  • can comeone send me the code please???

  • ERRRROSSS!!!!!!!!!!!!!!!!!!!!!­!! :@

  • f uk this too much brackets and deleting!!!!!!!!!!!!!! 

  • @squernerproductions

    Be sure that after every echo command is a ; (semicolom or something) so like:

    echo ("Test");

  • it never says please fill in all fields

  • could you post the final code for this one , too many deleting and too many bracket

    Thank you

  • Great great great tutorial.

    Thanks.

  • young man you seem to know alot but you should prepare your courses better than that...

  • Ok I have done it all , and it dont work as intended.

    It says my password is to long, its becuse the md5 encrypted password make it longer then 25 characters.

    So I am guessing one have to md5 encrypt it after one has done the check of strlen on the password, correct?

  • @SwampDragons yes

  • @SwampDragons

    /*

    No i got the same problem... and it is very easy to fix. before you make md5 hash you will have to make another varible that takes in the number of your password. like

    */

    $password_lengdt = strlen($password);

    //then, be careful - it MUST be after, you can put in this

    $password = md5($password); //and have the code hashed

    //and then

    if(($password_length>25)||($pa­ssword_length<6)){}

  • @steverock85

    Sorry for my bad grammar:/

    "then, be careful - it MUST be after, you can put in this" is supose to be

    "then after, you can put this"

    You put $password_lengdt = strlen($password); before $password = md5($password);

    if you don't you will getg the length of the hashed code you made....

    ohh what ever, it is common sense anyway.... sorry if this confused you...

  • @SwampDragons

    ohhh he accually fixed this later in the tutorial, my bad.... note to self, watch all if you get into trouble....

  • Apparently according to my PC, my system data isn't trustworthy, not letting me use the date function, did it ever happen to any of you?if it did is it solvable?

  • @zemma1992 use

    date_default_timezone_set('UTC­');

    before youre first function

  • I'm so confused! I try to follow every characters that he typed. only errors result appears in my browser. :( could you make another php login tutorial again? tnx!

  • you're trial and error tutorial makes us confused!!!

  • what are these characters after typing "if (strlen($username)>25(????) please i need your help,,

  • Comment removed

  • guys it keeps telling me this: "Please fill in all fields" after everything i type. even after i fill in all fields. i tried finding the error but i couldnt so i went and retyped the whole script focusly and i still got the same error. please someone help

  • hey guys im going to copy and paste my code heres the problem i copied him almost exactly but whenever i test it out it keeps saying after i register no matter what i put in "Please fill in all fields" I've tried to find the errors but I can't! Can someone help?

  • @MrPayDay123 nvm XD its not letting me but if its not to much trouble if u could plz message me your code so i can copy and paste??

  • @MrPayDay123 me too!

  • @MrPayDay123 where's the code? I maybe able to help

  • @MrPayDay123

    I got the same error please somebody help

  • @MrPayDay123 maybe you missed or misplaced a bracket in the conditional statements -- If and else.

  • @MrPayDay123 if you send me your email once i finish making it ill send you the files so you can compare and find your errors if you still need it

  • @MrPayDay123 You need to learn to debugg mate. There are techniques for that, just google it.

  • @MrPayDay123 It took me effing hours to know what's exactly my problem is...

    so in the end I finally did it and here's whut I've did I know it's 9 months late probably ur professional now XD but just in case (--,)b if (isset($fullname)&&isset($user­name)&&isset($password)&&isset­($repeatpassword)) {  if (isset($password) == isset($repeatpassword))

    I tried putting isset thing-y so tht would make it work XD

  • Man u delete some things which i am getting an error :(

  • where can i download the project files?

  • I always get this "unidentified index" error

    I've followed everything you did.

  • Is there a reason to check for user/pass length other than protect from someone entering extremely long data.

    You could do something like this:

    if(strlen(implode("",$_POST))>­200)

    Otherwise the things I hate the most is when I want to test a service and don't care about my account and I get errors with to short /to long/ or other things.

    I really love your videos and it is pretty clear what you do.

  • what is wrong with my php coding :(

    techuniquekeys. co.uk / help.txt

  • help. 5:38

    I typed everything you typed and from where it says "25||strlen($fullname)" throughout the rest of the php code everything is showing. How do I get rid of the php code? Meaning make it invisible?

    if (strlen($username)>25||strlen(­$fullname)

    did I type it right? Because like I said, it is visible like a text when it is supposed to be invisible like the function.

  • I will send the whole code that I have written in a PM.

  • It's really annoying that I have to pause all the fucking time. Good tutorial except for that though.

  • Comment removed

  • Comment removed

  • adding a "maxlength='number here'"

    in the <input

    at the text fields is bether than using if's for it. Just a note...

  • Why do i keep getting this error

    "Notice: Undefined index: submit in (wamp path) on line 14"

    I must make a if($_POST['submit']) and then set the variable or else it doesnt work

  • i dont understand is there a website with codes on it for us to look at? PLEASE HELP!

  • your tutorials rock!

  • lol, i had to google existence, looks like we were both wrong =)

  • Parse error: syntax error, unexpected '{'

    what does this mean

  • @Warstu It means you have an extra curly brace where not needed

  • @Warstu I believe it means that you accidentally used a { instead of a (. Did you get it fixed?

  • @Warstu olhe o código e veja o que tu escreveu de errado , mas olhe com atenção .

    .

    look at the code and see what you wrote wrong, but look carefully.

  • @Warstu it means there is an unexpected {

  • Comment removed

  • @Warstu That you didnt close your bracket right

  • @Warstu error is useless without the code

  • @Warstu it means there is an extra '{' that does not need to be there - use an IDE that picks these errors up and finds them for you while you're writing the code!

  • i need help with this

  • simple md5 password hashing can be cracked.

    You need to add salt to make it more secure, something like this:

    $salt = "567ujasd3";

    $password = md5($salt.$password);

  • Dude you fucked me when u delete some text im so confuse now :( and now when i type any pass this say text of maximum and minimum caracter

  • I think you need to redo this tutorial. Whenever you delete something, I fucked up and had to do the whole thing over -.-..

  • Just wondering if anyone else is getting the error

    Notice: Undefined index: submit in (Directory) on (line)

    if so how do i resolve this?

  • The video works fine here.

  • Video not work

    hmmm

    Anybody need alternative url

    Only video part 3 not work

  • Hooray. Happy Birthday "This Video" Your age is: 1year

    You were uploader 09-02-20 and today is 10-02-20

  • How can I keep a form on the screen with the error message after the data has been submitted and written to the database. It seems that the defualt behavior is for the form to dissapear.

  • OMG. I just completely FUCKED up on this tutorial. FUCK FUCK D;:: -.--.-.--.- shit. I was looking forward to this.. :(

  • well just have a look at it again and try to understand it... I am getting the logic but.. only when he shows it but if you ask me to make all those check things I'll get fucked up as well :D

  • Yeah well Its ok. I learned MySql and hooked it up to a database and made an insert script so I have a fully functional Register and login :P I just have to tweak a few things though.

  • howcome this video will not load ??

  • Comment removed

  • guys!

    can you please help me? im trying to upload my files to an online host, but i can't connect there to mysql. can anyone give me a connectable host?

    thanks!

  • What are you talking about? Nobody can simply give you a host to connect to. ???

  • lol... i can get you a domain that has a simple interface for sql.. thats either your localhost.. or 000webhosts

  • Encryption doesn't work. I hand coded mine and on the database, the user had to login with the encrypted password. Is there a tag that doesn't make a difference in database but still encrypts that password?

  • Comment removed

  • I'm kind of new at this, but don't you need a different variable for the new encrypted passwords? I could be wrong

  • great tutorial

    9stars

  • Comment removed

  • Yeah...I am sure that will be corrected out in part 4...Thanks Alex for this tut anyway and I really highly appreciate your efforts!

  • ATTENTION!!!

    Do watch part 4 for a small mistake in this part 3.

    You did everything right, even if it says "Password must be between 6 to 25 characters".

    Just comment out the hashing with // and continue.

Loading...
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more