Hey Alex, thank you so much for your time in making these clips. I've learned so much since I started watching them. I am having some difficulty with them as I have altered them to conform to my website. I was wondering if there were source codes for these tutorials as I have spent the last two weeks pouring over the code and have not found the problem yet. Again thanks for your time in making these.
i've only been exposed to PHP for close to 3 months now...u can say im still an extreme novice...but i gotta say, that these tutorials are absolutely brilliant. no matter what others have said about them, or the dislikes about them, they are just fantastic. easy to understand. if you follow them step by step, and be patient, they are very helpful. thank you so much!
You can check if the user exists by using his login example. $query = mysql_query("SELECT * FROM users WHERE username='$username'"); $numrows = mysql_num_rows($query); if ($numrows!=0) { while ($row = mysql_fetch_assoc($query)) //Checks the password $dbusername = $row['username']; $dbpassword = $row['password']; } if {blah blah blah (check if username and password match)} else die("The username is already taken")
Your tutorials are very helpful and informative, but I am a php rookie and sometimes it's hard to keep up. I am having trouble with some errors here and there but your acknowledgment of your own mistakes and encouragement to seek through the code for mine has made me feel like I am just making common trip ups like anyone else.
Thanks for a great tutorial, I will definitely be back for more!
you are my php hero...thanks mate.your tutorials are very clear..most likely think is the way your are solving errors. its is very help full for me...thanks you very much
Dear Alex, this is the first tutorial that you have made that I have tried my hardest not to exactly duplicate, but to add my own little coding style to it. This tutorial has been AMAZING to help me remember things like semi colons to terminate and just learn altogether, I would recommend anyone in an intermediate level looking to polish up some skills to this tutorial, I love you, =P
how do you fix the MD5 error problem, the user is in the DB with correct username and password then when I try to login it says username or password incorrect.
If you re-type the password wrong, ALL box text will be deleted. if I press back in my browser all the content will apear again because of the echo $fullname But why do I have to go back in my browser to see it?
Quick Question: If there is no POST data to be echoed by php as a value in the form fields, I am getting an "undeclared variable" error message. In other words, the first time my register page is visited, I am getting error messages above the input fields.
How do you code the register.php page such that a user's first visit (ie there is nothing to be echoed in the form fields) will display a clean empty form instead of an error message as a result of an "undeclared variable?"
but how can i move the result to another place in website?
i want all the warrning result be in the same page with the form ,so if it shows username already exist for example iwant it to be undeer the form so they wont go back?
There is a big problem, with this script you can have an unlimited number of users with the same username. You never check during the registration if the username already exists in the database.
@daeheadshot this checks if the database already has the username. $query = mysql_query("SELECT * FROM users WHERE username='$username'"); //queries database for usernames $numrow = mysql_num_rows($query); if ($numrow!=0) { // if rows are not empty while ($row = mysql_fetch_assoc($query)) { $dbusername = $row['username']; } //check to see if matched to any user if ($username==$dbusername) { //if username is already stored in database die("Sorry. Username is already taken."); } }
I'm not talking about that part . Take the code you have done from this video and try and register and then create a password less than 6 characters. It will say you have been registered, and it will also say passwords must be between 6 ad 25 characters.
The user is registered into the database even though they got an error while running the register script.
alex, I like how you sometimes make common mistakes that most of us will also make, it just helps the learning a lot when I am making mistakes and solving them. THANK YOU!
I mean, if an attacker gained access to your database, they can get the md5 hash, use an md5 decrypter or check a rainbow table and recover the password. Unless maybe you used a salted password.
I followed this series of tutorials exactly and until now I've had no problems. I have coded the same perfectly but no matter what I always get "Incorrect Password" when I attempted to login with my created account. Anyone else having this problem?
@AlexGuerrero007 Well, yes, but... you got 36 characters (a-z and 0-9) to mix freely on 32 spots in the md5 string, that means the amount of combinations = 32^36 which is equal to 6.33402867 × 10^49 different combinations, which is: 63 340 286 700 000 000 000 000 000 000 000 000 000 000 000 000 000 different combinations, so i'd say ur fairly safe with md5 ;)
I followed all of your tutorials up to and including this one and I've had no problems yet, great tutorials by the way! but I have now run into a problem. I changed the length of characters in phpmyadmin for the db to 100 and added md5( to the password part in the login. When I sign in it says you've logged in successfully, click here to continue to your account. But when I'm on the account page, it says please login to your account. What have I done wrong for that to happen.
THANK YOU! Your tutorials are the best! I am a student and without your tutorials i'd have a hard time at school! Thank you very much! Respect!
p.s: I cant find a tutorial on how to use javascript in php. Is it possible? Like when you echo succes could javascript alert box opened and write success or avtomatic redirect back to index page? Tnx.
@sabalmoza Javascript is possible in php yes. It's all about the order you put it in. Go to w3schools com and they will definately help with any problems you may be having with that.
Hey. Good day to you. I have a problem with regards to registering users. When i click register, following notices appears. Notice: Undefined index: submit in Notice: Undefined index: fullname in Notice: Undefined index: username in Notice: Undefined index: password in Notice: Undefined index: password in All files in mylocal. Hope you can, teach me how to resolve it. many thanks codec
@codecbreaker i guess the problem is because you are defining the variables like $username and $password before checking if the register button is pressed.
Try including the variables inside the check. eg :
For whatever reason when I try to insert into my db it doesn't insert the info.
I changed my pw to hold a length of 32 and still had problems so I put a "or die(mysql_error());" after my mysql_query function and got this as an error:
Incorrect integer value: '' for column 'ID' at row 1
any ideas to why this is?
Here is my query:
mysql_query("
INSERT INTO users VALUES ('','$firstName','$lastName','$username','$password','$email','$date')
@brEws0 I figured out my problem apparently windows versions of phpmyadmin have bugs so the fix is rejecting the ID field completely in your query but you have to specify which fields you want to insert into the db eg.
INSERT INTO users (fullname, username, password, date) VALUES ('$fullname','$username','$password','$email','$date')");
(fullname, username, password, date) comes directly from the fields in my db the auto_increment handles setting the ID.
Hey Alex, I keep getting a user login error i followed the code exactly. If I I login using the md5 password its fine but cant login normally. thanks!
to fix the md5 probelm. another way you can do it is on ur login.php file u have if ($username&&$password). Change it to if ($username&&md5($password)) while u still have the md5($password)==$dbpassword. Problem sloved without the hassel of increasing the password value :)
Can you please expand on this by having it so that after a registered user logs in they are taken to a page that is specific to them? I am a teacher and I want to add something like this to my class site so that I can actually leave my students secure comments and links and things on their "User Page" that shows up only to them after they've logged in with their information. Thanks for any help you can give! God bless!
I get this error when I navigate to the register page that I created using your code on the Register tutorial you did. On that line is a die message saying that you have successfully registered.
Parse error: syntax error, unexpected T_EXIT in C:\Xampp\xampp\htdocs\phpacademy\register.php on line 45
@GDamnGuy DEAR CHEK YOUR PAGE REFERENCE THEN APPLY THE CHECKS ON EACH VARIABLE WHICH YOU MAKE TO STORE THE VALUES LIKE _POSTED VALUES AND DATABASE CONNECTION AND ALSO APLY CHECK ON QUERY RETRIVEL THEN SEE WHAT HAPPEN
Alex, I dont know whether this is just my problem or a general problem with the user login, I have set my username as the PK in MySQL as you dont want two users with same usernames, however if i register under 1 username then register under different name but use the same username the form says I am registered but the user does not appear in the database, can you shed any light on this?
you rock, dewd. i'm learning with your tutorials....they are great and useful ! but, you are in a hurry, so take it eazy.... let us time for looking and doing :)
Everything other than the password is working for me. It only registers "password" as the password and will not accept any other values. Looking at your code i can't notice any differences. :s
Hi, thanks so much for the great tutorials! Do you have any tutorials that demonstrate use of classes? I understand the basics of classes but would like to see classes interacting with other classes and more practical examples. Thanks!
read somewhere that MD5 encryption needs a 32 character field to store the encrypted password, so defining your password field to VARCHAR with length=32 on your USER table should work
good stuff. I learned more from these tutorials (3 user login + 5 register) in a day or so ... than I would learn from lectures / notes / reference manuals in months. got all of this code to work! great teaching style.
yess we want to expand this tutorial! really help. uhm. i also want to know to edit or update and also to display the submitted data.. uhm. the other comment has a point. what if the username they enter is already taken. u know your tutorial is the best among all those i have searched. this really helps me on my studies. thank you so much!!!♥♥♥
Thanks a lot. I learned some really useful things from the registration tutorial such as keeping the form fields filled in, making sure the password field in the DB can accomodate the password hash, and submitting a form to the same page. Great stuff.
Hey Alex, thank you so much for your time in making these clips. I've learned so much since I started watching them. I am having some difficulty with them as I have altered them to conform to my website. I was wondering if there were source codes for these tutorials as I have spent the last two weeks pouring over the code and have not found the problem yet. Again thanks for your time in making these.
lostnvegas 1 day ago
Thank you :D
TheLoLGameplays7312 6 days ago in playlist Register & Login
THANK YOU SO MUCH!!!
29GiaN23 2 weeks ago in playlist Register & Login
Parse error: syntax error, unexpected T_ECHO in C:\xampp\htdocs\register.php on line 25
My error!
16Pax 2 weeks ago
Comment removed
16Pax 2 weeks ago
Thank you so much . your the best Tutorial !
gujar687 2 weeks ago
'very nice tutorial!! Thank you
BenDavidSouth 3 weeks ago
Comment removed
BenDavidSouth 3 weeks ago
thank u so much! ur d man!
ekimarom 1 month ago in playlist Register & Login
thanks mate, really helped
armansrsa 1 month ago
you helped me a lot! Thank you
17ronaldoo 1 month ago
can i get this code please?
decpradeep91 1 month ago
youtube now becoming more and more money chaser!! stop that dumbass ads!!
Exrienz 1 month ago
it still says my password is incorrect even after having changed my database $password character length to 1000 characters.
cyberswim 1 month ago in playlist Register & Login
Comment removed
MistoKurdish 1 month ago
i've only been exposed to PHP for close to 3 months now...u can say im still an extreme novice...but i gotta say, that these tutorials are absolutely brilliant. no matter what others have said about them, or the dislikes about them, they are just fantastic. easy to understand. if you follow them step by step, and be patient, they are very helpful. thank you so much!
getupkid203 1 month ago
This has been flagged as spam show
Fatal error: Can't use function return value in write context in C:\xampp\htdocs\bautista\login.php on line 20
my line 20 is if ($username == $dbusername&&md5($password) = $dbpassword)
why does it says fatal error
lenoj02 1 month ago
Can't use function return value in write context in C:\xampp\htdocs\bautista\login.php on line 20......
this is the line if ($username == $dbusername&&md5($password) = $dbpassword)
why does this problem go out?
lenoj02 1 month ago
emrickgj 1 month ago
@emrickgj omg I lost all my formatting. uhh. . . yeah go to his login example
emrickgj 1 month ago
Ok then, how do I check that the username hasn't already been taken?
PktMma 1 month ago
@LEilllLEi his version is from 2009, its almost 2012, so the format has been modified somewhat.
YourMother1337 1 month ago
my register isnt working !!! php academy. org/
forum/ post69915.html#p69915
l4dhehe 2 months ago
@l4dhehe what exactly is the error?
YourMother1337 1 month ago
Your tutorials are very helpful and informative, but I am a php rookie and sometimes it's hard to keep up. I am having trouble with some errors here and there but your acknowledgment of your own mistakes and encouragement to seek through the code for mine has made me feel like I am just making common trip ups like anyone else.
Thanks for a great tutorial, I will definitely be back for more!
~Komrade Vlad
KomradeVlad 2 months ago
you are my php hero...thanks mate.your tutorials are very clear..most likely think is the way your are solving errors. its is very help full for me...thanks you very much
prageethpasyala 2 months ago
you should learn some better html syntax
realtuty 2 months ago in playlist Register & Login
HELP when i click on register i have this error
Notice: Undefined index: submit in C:\xampp\htdocs\login\register.php on line 4
Notice: Undefined index: Name in C:\xampp\htdocs\login\register.php on line 5
Notice: Undefined index: username in C:\xampp\htdocs\login\register.php on line 6
Notice: Undefined index: password in C:\xampp\htdocs\login\register.php on line 7
Notice: Undefined index: repeatpassword in C:\xampp\htdocs\login\register.php on line 8
DarlingBryan 3 months ago
@DarlingBryan
place an
@
before the
$_POST['submit']
so it looks like
@$_POST['submit']
AbhishekPratapa 3 months ago
@DarlingBryan Do that for every one
AbhishekPratapa 3 months ago
@AbhishekPratapa thanks the guy from the phpacademy taught me that too!
DarlingBryan 3 months ago
Thanks a lot...
ClimateUK 3 months ago
echo "Alex:
Great work, you come to the level of user and then explain every thing absolutely beautiful";
sabexel 3 months ago
Dear Alex, this is the first tutorial that you have made that I have tried my hardest not to exactly duplicate, but to add my own little coding style to it. This tutorial has been AMAZING to help me remember things like semi colons to terminate and just learn altogether, I would recommend anyone in an intermediate level looking to polish up some skills to this tutorial, I love you, =P
iAgentDrizzy 3 months ago
Your tutorials are great!....Would you be willing to do a tutorial on how to create a clear button that clears all fields once clicked?
Naeem237 3 months ago
@Naeem237 there is one in HTML, it resets the form. input type="reset" value="reset"
getupkid203 1 month ago
@getupkid203 dont forget to put the open and close tags on each end...
getupkid203 1 month ago
@phpacademy, What if a user tries to register with the same username as another user ? Can you show us how we can prevent it ?
LambosWebs 4 months ago in playlist More videos from phpacademy
Correct me if I'm wrong.
My research says that
hash('sha512', $password, false);
is far more better than md5($password);
encryption
classiqueheart 4 months ago
how do you fix the MD5 error problem, the user is in the DB with correct username and password then when I try to login it says username or password incorrect.
Daltonson 4 months ago
I'd like a simple script as a n IF statement to check if the user is logged in. then do a set of commands.
dreamvoidTV 4 months ago in playlist More videos from phpacademy
If you re-type the password wrong, ALL box text will be deleted. if I press back in my browser all the content will apear again because of the echo $fullname But why do I have to go back in my browser to see it?
ShaneNL69 5 months ago in playlist MYSQL PHP
Try it, if you type in the password wrong, you will get "Your passwords do not match" and all the content is deleted.
And if you go back in your browser you will see everything again. But if you refresh the page all will be deleted. Help please!
ShaneNL69 5 months ago in playlist MYSQL PHP
Comment removed
ShaneNL69 5 months ago in playlist MYSQL PHP
awesome man, suscribed you! thanks for great tuts n keep up de gr8 work :)
TheRishikumra 5 months ago
if i'm register the account isn't in my database D: Please help me!!!
mehdolino1999 5 months ago in playlist Register & Login
awsome work buddy thanks heeps :-D
trigger32nz 6 months ago
This has been flagged as spam show
i already done this in tutorial 4 and i dont have a error message..(?)hmmmmm
vahnvallain 6 months ago
Comment removed
vahnvallain 6 months ago
Remove unwanted errors when a variable isn't declared by placing this code at the top of your php file:
error_reporting (E_ALL ^ E_NOTICE);
This works on all your pages.
Thumbs up so everyone can see!
MushroomWarz 6 months ago 2
Thanks Alex!
Quick Question: If there is no POST data to be echoed by php as a value in the form fields, I am getting an "undeclared variable" error message. In other words, the first time my register page is visited, I am getting error messages above the input fields.
How do you code the register.php page such that a user's first visit (ie there is nothing to be echoed in the form fields) will display a clean empty form instead of an error message as a result of an "undeclared variable?"
jonestyler22 6 months ago
Thank you SO much for this tutorial! I am a total PHP N00B and I understood everything.
datrizz 6 months ago
"0:48 typed in a load of rubbish here."
i swear the accent is the best lol.
terraf1rma 6 months ago
great tutorial but i think that you forgot to check if usere name already exist
loyp1 7 months ago
thank u ,
but how can i move the result to another place in website?
i want all the warrning result be in the same page with the form ,so if it shows username already exist for example iwant it to be undeer the form so they wont go back?
iraqsunshine2011 7 months ago
Thank you! But can you not make a opdate where you show how to move all the boxes to another place of the website? :D That could be really nice :)
NightmanPixelMan 7 months ago
This has been flagged as spam show
Thanks alex, My personal thanks in a video for phpacademy!
watch?v=DTSooY8fqpw
SilverMagics 7 months ago
lol I tried to sign into the phpacademy Youtube account using sliceruk1
Grkgermn333 7 months ago
Good job. Thank you very much. .Awesome...
lubos1998 7 months ago
Thank you and very good job. thanks
samersal 8 months ago
Very nice tutorials! Helps me understand the basics of PHP alot faster!
dawhu 8 months ago
There is a big problem, with this script you can have an unlimited number of users with the same username. You never check during the registration if the username already exists in the database.
Scott38660 8 months ago
yay i got an error Parse error: syntax error, unexpected T_ELSE in /blabla my website/register.php on line 30
DoffyElfunk 8 months ago
Best user and login registration tutorial, it works perfect to me (i had a litle problem with the md5 part, but is fixed now!! THANKS ALEX!!!!!
ferdinandelfacho 8 months ago
Comment removed
DeadListening 8 months ago
I would just like to say thank you very much, very nice job and I look forward to your future videos!
dwbcinemas 9 months ago
you didnt show us how to check if the username is already taken!!!!
daeheadshot 9 months ago 2
@daeheadshot no brainer. use an if statement... if($username==$dbusername) echo "Username taken."; It's just common sense.
Acceptable76 8 months ago
Comment removed
ilovetheinternet 1 month ago
ilovetheinternet 1 month ago
With your help, I managed to get it all working, and even managed to add a Captcha image as well.
Much appreciated, bro!
Nightmizzle 9 months ago
This is powerful stuff.
Vortex42 9 months ago
@rhoffer21
I'm not talking about that part . Take the code you have done from this video and try and register and then create a password less than 6 characters. It will say you have been registered, and it will also say passwords must be between 6 ad 25 characters.
The user is registered into the database even though they got an error while running the register script.
ljk1181 10 months ago
the register code doesn't work properly. fill in all the fields and input a password less than 6 and it will still register the user.
ljk1181 10 months ago
@ljk1181 That was addressed two tutorials ago, take a look at that one.
rhoffer21 10 months ago
u actualy are the best, ever throught of becoming a lecturer?
mineshmandalia 10 months ago
still cant login D:
it says incorrect password!
FlamingSwordPro 10 months ago
Hey, thanks for making the video.
Mine's working, it registers a user and says 'you're in Click here to enter the member page.'
However, when i click 'here' to enter, it says you must be logged in.
tips?
salrathor1 10 months ago
@salrathor1 Session variables
rhoffer21 10 months ago
When i use md5($password) it says incorrect password and when i take it off it works but my varchar for password is set for 100 any help?
iamjoseph951 10 months ago
@iamjoseph951 he went thru that -.- watch the video again.
terraf1rma 6 months ago
Comment removed
iamjoseph951 10 months ago
try this:
if(isset($_POST["submit"]))
{
$fullname = strip_tags($_POST["fullname"]);
$username = strip_tags($_POST["username"]);
$password = strip_tags($_POST["password"]);
$repeatpassword = strip_tags($_POST["repeatpassword"]);
$date = date("Y-m-d");
}
tiankrisz 10 months ago
This has been flagged as spam show
Always "Notice: Undefined index: submit in C:\xampp\htdocs\xampp\clyde\register.php on line 4
Notice: Undefined index: fullname in C:\xampp\htdocs\xampp\clyde\register.php on line 6
Notice: Undefined index: username in C:\xampp\htdocs\xampp\clyde\register.php on line 7
Notice: Undefined index: password in C:\xampp\htdocs\xampp\clyde\register.php on line 8
Notice: Undefined index: repeatpassword in C:\xampp\htdocs\xampp\clyde\register.php on line 9" i get in register.php.why..but itis working
lyderx02 10 months ago
Always "Notice: Undefined index: submit in C:\xampp\htdocs\xampp\clyde\register.php on line 4
Notice: Undefined index: fullname in C:\xampp\htdocs\xampp\clyde\register.php on line 6
Notice: Undefined index: username in C:\xampp\htdocs\xampp\clyde\register.php on line 7
Notice: Undefined index: password in C:\xampp\htdocs\xampp\clyde\register.php on line 8
Notice: Undefined index: repeatpassword in C:\xampp\htdocs\xampp\clyde\register.php on line 9" i get in register.php.why..but itis working
lyderx02 10 months ago
alex, I like how you sometimes make common mistakes that most of us will also make, it just helps the learning a lot when I am making mistakes and solving them. THANK YOU!
raygun369 10 months ago 32
Is MD5 really safe??
I mean, if an attacker gained access to your database, they can get the md5 hash, use an md5 decrypter or check a rainbow table and recover the password. Unless maybe you used a salted password.
MattDurden 10 months ago
md5 will be good in $_POST
magikshot 11 months ago
I followed this series of tutorials exactly and until now I've had no problems. I have coded the same perfectly but no matter what I always get "Incorrect Password" when I attempted to login with my created account. Anyone else having this problem?
MrMartinJS 11 months ago
Thanks guys :)
FPSRecorder 11 months ago
wow I'm learning a lot from this than those stupid pdfs I download all the time
mrpotatohead91 11 months ago
I keep getting a 'unexpected T_STRING'
on this line: mysql_select_db("phplogin");
FPSRecorder 1 year ago
@FPSRecorder check above that line of code for things missing like semi-colons and unclosed speech marks :)
supergaybot 11 months ago
@FPSRecorder
its because you have to use the single ' instead of double ".
Imbalism 11 months ago
@FPSRecorder
you most likely forgot to put a ';' after the $connect line
snowboardr1016 10 months ago
This has been flagged as spam show
Why we need a, latin bitch busizz4me.info
DonsanUsake569 1 year ago
Anything encrypted with md5 will ALWAYS a length of 32 characters!
Always good to know =)
gDoxe 1 year ago 26
@gDoxe that means that more passwords can have the same md5 chiper..... :)))) so md5 isn't good for password encryption .. lol
AlexGuerrero007 6 months ago
@AlexGuerrero007 Well, yes, but... you got 36 characters (a-z and 0-9) to mix freely on 32 spots in the md5 string, that means the amount of combinations = 32^36 which is equal to 6.33402867 × 10^49 different combinations, which is: 63 340 286 700 000 000 000 000 000 000 000 000 000 000 000 000 000 different combinations, so i'd say ur fairly safe with md5 ;)
Im quite sure my math is correct =>
gDoxe 6 months ago
all done really nice tutorial. do we have any anything in reverse for md5 or we are secure here.
p050017 1 year ago
nice tutorials .. thanx a lot for uploading..
mustansa 1 year ago
One question, would this I've learned be safe to the outside world? (sql injections and stuff like that)
Robber7 1 year ago
I followed all of your tutorials up to and including this one and I've had no problems yet, great tutorials by the way! but I have now run into a problem. I changed the length of characters in phpmyadmin for the db to 100 and added md5( to the password part in the login. When I sign in it says you've logged in successfully, click here to continue to your account. But when I'm on the account page, it says please login to your account. What have I done wrong for that to happen.
SkySkraper1212 1 year ago
THANK YOU! Your tutorials are the best! I am a student and without your tutorials i'd have a hard time at school! Thank you very much! Respect!
p.s: I cant find a tutorial on how to use javascript in php. Is it possible? Like when you echo succes could javascript alert box opened and write success or avtomatic redirect back to index page? Tnx.
sabalmoza 1 year ago
@sabalmoza Javascript is possible in php yes. It's all about the order you put it in. Go to w3schools com and they will definately help with any problems you may be having with that.
MrPayDay123 1 year ago
done everything and everything seems to be working fine except it only say im registered but nothing is stored on my database
i already did all the corrections below but it is still not working ..pls help :(
philmarlthegreat 1 year ago
This has been flagged as spam show
Heck out the thousands of profiles for Naughty women mworld5.info
MARGRETDOLORES 1 year ago
very good tutorial. thanks.
manamsaeid 1 year ago
Email Verification and Captcha.
joshaz1995 1 year ago
This has been flagged as spam show
Do you find a trusted wife gettop5.info
FlemingAldridge 1 year ago
fast easy learning! :D subscribed and rated
arcanists2000 1 year ago
codecbreaker 1 year ago
@codecbreaker i guess the problem is because you are defining the variables like $username and $password before checking if the register button is pressed.
Try including the variables inside the check. eg :
if($_POST['submit'])
{ $username=$_POST['username']; $password=$_POST['password'];
}
This worked for me!
Hope it works for u too.
happy diwali!
cheers
boneysin 1 year ago
Will be great if u make those in mp3 audio format so people can listen and understand the php basics.
Rogueixpresents 1 year ago
i can watch these tuts all day...thanks man
rscp1050 1 year ago
thank you very much for your tutorial helped me
cknicfest 1 year ago
how do you un-encrypt the password :P
captainchris12 1 year ago
The field length in the db was the bug. Very tricky. Good to know. Thanks
nattsurfaren 1 year ago
For whatever reason when I try to insert into my db it doesn't insert the info.
I changed my pw to hold a length of 32 and still had problems so I put a "or die(mysql_error());" after my mysql_query function and got this as an error:
Incorrect integer value: '' for column 'ID' at row 1
any ideas to why this is?
Here is my query:
mysql_query("
INSERT INTO users VALUES ('','$firstName','$lastName','$username','$password','$email','$date')
") or die(mysql_error());
Thanks a lot.
brEws0 1 year ago
@brEws0 I figured out my problem apparently windows versions of phpmyadmin have bugs so the fix is rejecting the ID field completely in your query but you have to specify which fields you want to insert into the db eg.
INSERT INTO users (fullname, username, password, date) VALUES ('$fullname','$username','$password','$email','$date')");
(fullname, username, password, date) comes directly from the fields in my db the auto_increment handles setting the ID.
brEws0 1 year ago
@brEws0 still the problem isnt solve :/
philmarlthegreat 1 year ago
Ur the Best... imo subscribe...........
jeradluva 1 year ago
omg i get this error , Parse error: syntax error, unexpected '}'
Fallingb0y 1 year ago
Comment removed
brEws0 1 year ago
Hey Alex, I keep getting a user login error i followed the code exactly. If I I login using the md5 password its fine but cant login normally. thanks!
RSkwiat 1 year ago
@RSkwiat I have this same exact problem, did you get it resolved?
aqcheryl 1 year ago
thank you very much! I had some problems but it worked perfectly!
XeniTenz 1 year ago
Why do I get this error? "Incorrect integer value: '' for column 'ID' at row 1" This is when I register a new user. It doesn't get added to the db.
VCSandARM 1 year ago
great tut....
thanx...
11Adityabhaskar11 1 year ago
thanks man, it was really good you helped me keep it up bro
akalilwayne1 1 year ago
to fix the md5 probelm. another way you can do it is on ur login.php file u have if ($username&&$password). Change it to if ($username&&md5($password)) while u still have the md5($password)==$dbpassword. Problem sloved without the hassel of increasing the password value :)
garky247 1 year ago
@garky247 thats exactly what he did......
EnvyMyPower 1 year ago
Can you please expand on this by having it so that after a registered user logs in they are taken to a page that is specific to them? I am a teacher and I want to add something like this to my class site so that I can actually leave my students secure comments and links and things on their "User Page" that shows up only to them after they've logged in with their information. Thanks for any help you can give! God bless!
lightvsdark21 1 year ago
Hey man i love you... finally something that really works... congratulations...
felipemcsk8 1 year ago
I get this error when I navigate to the register page that I created using your code on the Register tutorial you did. On that line is a die message saying that you have successfully registered.
Parse error: syntax error, unexpected T_EXIT in C:\Xampp\xampp\htdocs\phpacademy\register.php on line 45
VisualBasicGeek2010 1 year ago
I still had errors after making the password match the md5 DB password.
What I did to fix this was in $query change $password to md5($password).
sleepernoob 1 year ago
why does my page apears blank ( register.php ) ? NEED HELP!
GDamnGuy 1 year ago
@GDamnGuy DEAR CHEK YOUR PAGE REFERENCE THEN APPLY THE CHECKS ON EACH VARIABLE WHICH YOU MAKE TO STORE THE VALUES LIKE _POSTED VALUES AND DATABASE CONNECTION AND ALSO APLY CHECK ON QUERY RETRIVEL THEN SEE WHAT HAPPEN
FOR ANY HELP CONTACT TALIB_NAZ@YAHOO.COM
m29020 1 year ago
@GDamnGuy Theres most likely a error in your coded... Look for missin
"[,],(,),{,} and ;"
If you miss some it may resoult in your error
katt157 1 year ago
I can also cr8 multiple account with the same ID
1337Boredness 1 year ago
I have adjusted the password field to 200 chars, still no joy, I can register but when I go to log in the password error still comes up
dashbyictfd 1 year ago
@dashbyictfd have managed to solve it now
dashbyictfd 1 year ago
Alex, I dont know whether this is just my problem or a general problem with the user login, I have set my username as the PK in MySQL as you dont want two users with same usernames, however if i register under 1 username then register under different name but use the same username the form says I am registered but the user does not appear in the database, can you shed any light on this?
Thanks
dashbyictfd 1 year ago
Alex, any chance you can add an email field to this form with all the error checking for an email address format being entered?
dashbyictfd 1 year ago
you rock, dewd. i'm learning with your tutorials....they are great and useful ! but, you are in a hurry, so take it eazy.... let us time for looking and doing :)
dark3zz 1 year ago
Everything other than the password is working for me. It only registers "password" as the password and will not accept any other values. Looking at your code i can't notice any differences. :s
pritzp01 1 year ago
Hi, thanks so much for the great tutorials! Do you have any tutorials that demonstrate use of classes? I understand the basics of classes but would like to see classes interacting with other classes and more practical examples. Thanks!
tropicallanterns 1 year ago
what would happen if the user forgot their password? how can the use retrieve it?
SonoStudioz 1 year ago
THANKS MAN! YOU SAVE MY DAY!
optionz54bord 1 year ago
read somewhere that MD5 encryption needs a 32 character field to store the encrypted password, so defining your password field to VARCHAR with length=32 on your USER table should work
standingonthewater 1 year ago
good stuff. I learned more from these tutorials (3 user login + 5 register) in a day or so ... than I would learn from lectures / notes / reference manuals in months. got all of this code to work! great teaching style.
standingonthewater 1 year ago
yess we want to expand this tutorial! really help. uhm. i also want to know to edit or update and also to display the submitted data.. uhm. the other comment has a point. what if the username they enter is already taken. u know your tutorial is the best among all those i have searched. this really helps me on my studies. thank you so much!!!♥♥♥
mhengmheng24 1 year ago
it not works! It says always "password incorrect!"
aeroflighter 1 year ago
for some reason when i try .php, it wants me to download a file
Salamis2220 2 years ago
yeah, you have to put it up on a webserver, or a local server...
movierobban 2 years ago
@movierobban you have to setup a webserver in order to work with .php files, google up xampp and download it and you should be set.
Spidason 1 year ago
you're great man nice vid it helped me a lot
ehjhee 2 years ago
Thanks!! Nice tutorial!
HenryGAD 2 years ago
Great!! THANKS!! and subbed..
danielcreations 2 years ago
Thanks a lot. I learned some really useful things from the registration tutorial such as keeping the form fields filled in, making sure the password field in the DB can accomodate the password hash, and submitting a form to the same page. Great stuff.
fugazi0311 2 years ago
Very good tutorial!
Thanks!
ookamiwolf97 2 years ago
how do i make it so they cant use the same username as someone else??? did i miss that part somewhere???
insomniacmonkey69 2 years ago
He said it.
$get = mysql code;
while ($row = mysql_fetch_assoc($get))
{ $dbusername = $row['username'];
}
if ($dbusername = $username_who_the_user_wanted) echo "That username is already taken.";
viktorvettu 2 years ago
why didnt I just watch this first.... dang missing md5 - from first tut... :-)
Josabooba 2 years ago
Great!!!! Awesome!!!! Thank you Alex.
TheTyrhus 2 years ago
Great tutorials, man! Please, keep publishing new ones. Thanks for sharing.
marcelochiarella 2 years ago
vary good, tank you alex
alonthedj 2 years ago
A MD5 encryption is 32 chars .. :)
No need to over-do-it
hustler921 2 years ago
I did 50 to be safe and thought it would be slightly under it atleast, didn't want the password to be 100 characters to be honest.
PriditProductions 2 years ago
I had initially set my db md5 to 32 - as alex had initially - though it caused same error as him...
However, when i set to 100 like shown - it worked - - could you please explain more about what is behind this - ty
Josabooba 2 years ago
can we have an extra stage?
when the user register,
the admin need to approve it before the login can be use.
mayday82 2 years ago
There is a email verification tutorial by him. I am sure you can edit it so that it will do what you want.
moonfannia 2 years ago