@sukkejens Like what? You now know how to change data stored in your database, so that covers a lot of profile editing. phpacademy also has a profile on uploading pictures to the database.
like it !: eliminate first the two md5 from newpassword $_post
//check passwords if($oldcontrasena==$oldcontrasenadb) { //newpassword must be between 6 and 25 characters if(strlen($newpassword)>25||strlen($newpassword)<6) { echo ("the new password must be between 6 and 25 characters"); } else { //encrypt newcontrasena $newpassword = md5($newpassword); //check two new passwords if($newpassword==md5($repeatnewpassword)) { //success
@sayaro - it can't work, cus you are comparing the $oldpassword with the password in the database. The old password has to be encrypted 1st and then compared to the $oldpassworddb.
I think the way to probe the new password is over 25 and under 6 is doing it, make an "if" over //check two new passwords and put the check to new password inside " an else" write the strlen code like in registration page. Oh! and elimnate the md5 fomr the begining and make an md5 after checking strlen. I hope you understand my english.
if you want to add string length you'll need to add it exactly like you did with the register.php page except obviously you'll change the variables from $password to $newpassword and from $repeatpassword to $repeatnewpassword. You don't encrypt the password in the "//check fields" section, instead you encrypt them in the "//encrypt password" section in the else statement below the if($newpassword==$repeatnewpassword) statement.
can anybody help??!! As Alex menitoned at the end, when the user changes to a new password of less than 6 digits how can i limit that?? i tried to make an if statement with the "strlen" but the problem is that the password is already in MD5 encription and as like 30 digits or so.
@reben88 can you help??!! As Alex menitoned at the end, when the user changes to a new password of less than 6 digits how can i limit that?? i tried to make an if statement with the "strlen" but the problem is that the password is already in MD5 encription and as like 30 digits or so.
what i did with this.. is made an Administrator only page.. using his tutorials =) and then made it so that the admins can change a users password by typing hte ID of the user and a new password..
Just have to change "SELECT password FROM users WHERE username='$user'"
to "SELECT password FROM users WHERE id='$id'"
and the id is equal to a post of the id ( $id = $_POST['id']; )
i have a problem i got a comment page and a user has to login to post, that all works. now when a user logs in and comments on the page it adds then if another user logs in and comments, the other users comment shows up as the second users login and the comment that he sent.
user 1 "hitzy, Hello!"
user 2 " hitzy, helllo!"
this example shows who ever logs in their name comes, so i was wondering if you can help me figure out this problem please urgently required, thanks!!!!
Thank you, Alex !
MsKoko144 1 week ago
GOSH SO MUCH FOR TWO TUT'S.
but actually these are from 09, you should do some updates, like forgot password, and maybe some security updates.
qazwsx0987654312 1 week ago
Super Like!!! Super helpful.!!!
xoxoloveyou28 2 weeks ago
Comment removed
xxTechWiZxx 1 month ago
thank you!! this was easy to understand,
anassheroes 2 months ago
Thanks a lot!
ClimateUK 3 months ago
thank you!! this was easy to understand, and you taught it very good.
dust103194 4 months ago
Thank you sooooo much!! <3
lemaldita 4 months ago
You're awesome! You make it seem so simple. Thank you sooo much!
vjoho 6 months ago
THANK YOU SO MUCH
alonejms 7 months ago
how can i uppload it to the web with the "db"?
flaggis97 7 months ago
IDK if it was put in the video or not, but when you edit the changepass.php and put in the md5 stuff, go into your login.php and do this:
$password = md5($_POST['password']);
Because... $password = $_POST['password']; will echo the incorrect password error. If the md5 value is in the database.
DuncansCPGuide 8 months ago
Your fucking awesome i love your channel;)
but can you please make a video how to edit profile?
sukkejens 11 months ago
@sukkejens Like what? You now know how to change data stored in your database, so that covers a lot of profile editing. phpacademy also has a profile on uploading pictures to the database.
Grkgermn333 8 months ago
like it !: eliminate first the two md5 from newpassword $_post
//check passwords if($oldcontrasena==$oldcontrasenadb) { //newpassword must be between 6 and 25 characters if(strlen($newpassword)>25||strlen($newpassword)<6) { echo ("the new password must be between 6 and 25 characters"); } else { //encrypt newcontrasena $newpassword = md5($newpassword); //check two new passwords if($newpassword==md5($repeatnewpassword)) { //success
sayaro 1 year ago
@sayaro thanx alot man, had a lil issues still but this was a major help n guide
8998934 10 months ago
@sayaro - it can't work, cus you are comparing the $oldpassword with the password in the database. The old password has to be encrypted 1st and then compared to the $oldpassworddb.
xeniumatics 1 month ago
I think the way to probe the new password is over 25 and under 6 is doing it, make an "if" over //check two new passwords and put the check to new password inside " an else" write the strlen code like in registration page. Oh! and elimnate the md5 fomr the begining and make an md5 after checking strlen. I hope you understand my english.
sayaro 1 year ago
*Revisa si te falta o si agregastes mal un ; en todo el codigo.
sayaro 1 year ago
Revisa si no te falta o si agregastes mal un ; en alguna otra parte del codigo.
sayaro 1 year ago
I have a problem at line 12 I did everything like in tutorial
Parse error: syntax error, unexpected ';' in /members/changepassword.php on line 12
and this line 12 in my editor :
// check felds $oldpassword = md5 ($_POST['oldpassword']);
?????
cryptonim 1 year ago
i can change my username too right?
jock0man 1 year ago
if you want to add string length you'll need to add it exactly like you did with the register.php page except obviously you'll change the variables from $password to $newpassword and from $repeatpassword to $repeatnewpassword. You don't encrypt the password in the "//check fields" section, instead you encrypt them in the "//encrypt password" section in the else statement below the if($newpassword==$repeatnewpassword) statement.
SkySkraper1212 1 year ago
i think you speak wery well and i loved this tutorial.
thanks.
gkhnlts 1 year ago
can anybody help??!! As Alex menitoned at the end, when the user changes to a new password of less than 6 digits how can i limit that?? i tried to make an if statement with the "strlen" but the problem is that the password is already in MD5 encription and as like 30 digits or so.
PLEASE HELP! thanks
dennis3380 1 year ago
@dennis3380
i know how to do it but i am not so good in english and its complicated... If you got Skype Please add me: fredzy11
and il can help you from there ;)
fredzy1234 1 year ago
Aww ALEX Thank you veryyyyyyyyyyyyyyy muchhhhhhhhhhhhhhhhhhhh
reben88 1 year ago
This has been flagged as spam show
@reben88 can you help??!! As Alex menitoned at the end, when the user changes to a new password of less than 6 digits how can i limit that?? i tried to make an if statement with the "strlen" but the problem is that the password is already in MD5 encription and as like 30 digits or so.
PLEASE HELP! thanks
dennis3380 1 year ago
what i did with this.. is made an Administrator only page.. using his tutorials =) and then made it so that the admins can change a users password by typing hte ID of the user and a new password..
Just have to change "SELECT password FROM users WHERE username='$user'"
to "SELECT password FROM users WHERE id='$id'"
and the id is equal to a post of the id ( $id = $_POST['id']; )
digesteddonkey 1 year ago
@digesteddonkey
also you have to change
"UPDATE users SET password='$password' WHERE id='$id'" hte SET query.
digesteddonkey 1 year ago
hI Alex
That is really great tutorial.
Could you please add the min lengh function for newpassword?
cuiyan25 1 year ago
Thank you very much Alex!
eaglesphere03 1 year ago
i have a problem i got a comment page and a user has to login to post, that all works. now when a user logs in and comments on the page it adds then if another user logs in and comments, the other users comment shows up as the second users login and the comment that he sent.
user 1 "hitzy, Hello!"
user 2 " hitzy, helllo!"
this example shows who ever logs in their name comes, so i was wondering if you can help me figure out this problem please urgently required, thanks!!!!
r4d10mc 2 years ago
i didn't understand about that md5 hash code in part 2. i keep on having problems about that. could you explain it more clearer? can somebody help?
vcoydemo 2 years ago
thank you.........
sanu4as 2 years ago
thanks again! all your videos is great and makes me learn more than I've ever done at tutorials by text or videos at internet! really great!
viktorvettu 2 years ago
Superb ,Fantastic ,Mind blowing, outstanding
MrRajesh2709 2 years ago 2
Your tutorials of php are the best in the internet. Thanks for the videos.
italoven 2 years ago
indeed, I have very much enjoyed this tutorial Alex...Thanks A lot! Please keep on teaching!
omanoman98 2 years ago
Awesome. Thanks
irac78 3 years ago