I guess that making the field so wide it's unlikely that the rand generator will come up with the same number twice. However why take the chance and not just use an auto incrementing integer instead?
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\xampp\htdocs\register_handler.php on line 72
We could not sign you up at this time. Please try again later
How do I fix this! I'm not experienced with php but I'm getting there.
I keep getting incorrect password even tho i write it well , i think because i encrypted the password, i encrypted them in index.php and register.php and still get incorrect password when i dont encrypt them the password works what can i do help pls?
It looks like there's been changes from this code to the other registration tutorials. Please don't make a tutorial without the same coding, it'll just confuse us.
what if the same code is randomly generated twice? The last user to get it will net be able to register. Do you not need to add a constraint to stop this from happening?
@j0e151 You would not need a check for this because it is a unique code to everyone, you can add a constraint to see which user is logged in, then run a separate check to see if the users code is in the same table row as their username.
hi, thanks alot for your tutorial, I have just finished watching all your tutorials from the first login tutorial to this last one and I have been able to get what I want, you are realy blessed mate, thanks alot because this is gonna give me more marks in my final year project which am doing now, cheers
I would say the code alex did show wasnt the code that was running. If you code it like here you newer will get to a darn page where actualy shows you that you are logged in :DD so thats why he got the session name in front of the page but after that there must be an if statement so if there is an already running session then show a different content like a link to the exzisting logout page :DD. So this time the code was messed up a bit. :D
in activate.php u need to select a unique field as well, as depending only on $code is not enough, so mysql_num_rows($check) not nesessarli will equal only 1, suppose a user with activation code=123 for ex, is activated, and a new registered user has the same random code (no guarantee tht this couldnt happen) so when this new user tries to activate his account the script will say u r already activated, although he's not!
The tutorial has several weaknesses and is vulnerable to injections. You always should use mysql_real_escape_string and never addslashes, because addslashes does A) alters the original data physically B) is does not escape all potentially dangerous. See online docu for details, where it is explained.
It's possible to activate ALL inactive account with a simple injection. For UPDATE statements you also should always use LIMIT or little errors can result in applied changes to the whole database.
Part 2: Generally your tutorials are not bad for beginners, but because they are for beginners you should take extra care that you teach the newbies how to use PHP correctly. Means proper input validation, correct escape methods, and so on. For the register script, username and email column in the DB should be UNIQUE to avoid to have more than one account with the same user name/login name.
I guess that making the field so wide it's unlikely that the rand generator will come up with the same number twice. However why take the chance and not just use an auto incrementing integer instead?
PktMma 3 weeks ago
Guys I'm getting this error
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\xampp\htdocs\register_handler.php on line 72
We could not sign you up at this time. Please try again later
How do I fix this! I'm not experienced with php but I'm getting there.
Any help would be amazing!!!!
skopilianos 1 month ago
Comment removed
PrivateQueer180 3 weeks ago
@skopilianos You need a mail-sending server. Try downloading postcastserver. Search "php mail function" for more help over youtube. :)
PrivateQueer180 3 weeks ago
I keep getting incorrect password even tho i write it well , i think because i encrypted the password, i encrypted them in index.php and register.php and still get incorrect password when i dont encrypt them the password works what can i do help pls?
961banker 1 month ago
Thanks for tip, just notice that the code can (very small chance) be the same for (at least) two user since its generated by rand().
cachwahed 3 months ago
Can you please upload the code and set the link in the description?
DanielxMovies 4 months ago
omg i want a login in FLASH! not on a crap website!
Plasmaflix 4 months ago
use => $login_row = mysql_fetch_assoc($login) instead of the while loop because you only fetch data from one row
ShallowHeartNB 5 months ago
for this moment until the end of the times im going to follow u *-*
yipiyayoyu 6 months ago
how different is this tutorial 4m this 1(PHP Tutorials: Register & Login: Email activation (Part 5) ) which u made.....
krishnankuta 6 months ago
This has been flagged as spam show
Bro please help me for this Wanrning:
Warning: mail() [function.mail]: SMTP server response: 550 Authentication required in C:\xampp\htdocs\register.php on line 88
please give us a FREE SERVER URL for testing this email activation! everyone will sure appreciate it. THANKS! have a unity to all programmers! :D
krishnankuta 6 months ago
Thank you for doing these videos it is really helping me to learn PHP and set up a site. Hope u make money on adds
Best Wishes
Chris
cfgare 6 months ago
It Isnt that long!!! If you just explain a little faster, you might have been able to retype the code!
TheQaSpy 6 months ago
It looks like there's been changes from this code to the other registration tutorials. Please don't make a tutorial without the same coding, it'll just confuse us.
DuncansCPGuide 7 months ago
what if the same code is randomly generated twice? The last user to get it will net be able to register. Do you not need to add a constraint to stop this from happening?
Great tutorial though. thank you.
j0e151 10 months ago
@j0e151 You would not need a check for this because it is a unique code to everyone, you can add a constraint to see which user is logged in, then run a separate check to see if the users code is in the same table row as their username.
Sagaterious 7 months ago
Comment removed
j0e151 10 months ago
This has been flagged as spam show
Why we need a, latin bitch busizz4me.info
DonsanUsake569 11 months ago
This has been flagged as spam show
Heck out the thousands of profiles for Naughty women mworld5.info
MARGRETDOLORES 1 year ago
hi, thanks alot for your tutorial, I have just finished watching all your tutorials from the first login tutorial to this last one and I have been able to get what I want, you are realy blessed mate, thanks alot because this is gonna give me more marks in my final year project which am doing now, cheers
kozycool1 1 year ago
Hello, can I ask how if i forgot password?
himankerable 1 year ago
To use this email activation, do you need a email server?
TravisStewart999 1 year ago
I would say the code alex did show wasnt the code that was running. If you code it like here you newer will get to a darn page where actualy shows you that you are logged in :DD so thats why he got the session name in front of the page but after that there must be an if statement so if there is an already running session then show a different content like a link to the exzisting logout page :DD. So this time the code was messed up a bit. :D
mclaarson 1 year ago
Does he show the global.php page? I can't seem to find it.
damdempsel 1 year ago
in activate.php u need to select a unique field as well, as depending only on $code is not enough, so mysql_num_rows($check) not nesessarli will equal only 1, suppose a user with activation code=123 for ex, is activated, and a new registered user has the same random code (no guarantee tht this couldnt happen) so when this new user tries to activate his account the script will say u r already activated, although he's not!
Excelsoft 1 year ago
OMFG .. 20mins of footage !
Thefakerr 1 year ago
Wow dude this is like a Scam page...:D
adrianseverus 1 year ago
@superawesomesuperkid
yes you can do all in one page but, there is always a refresh
fastdrugs 1 year ago
Would setting the action as "#" or"#register" do anything to this? I want everything to run on one page. No refreshes.
superawesomesuperkid 1 year ago
The tutorial has several weaknesses and is vulnerable to injections. You always should use mysql_real_escape_string and never addslashes, because addslashes does A) alters the original data physically B) is does not escape all potentially dangerous. See online docu for details, where it is explained.
It's possible to activate ALL inactive account with a simple injection. For UPDATE statements you also should always use LIMIT or little errors can result in applied changes to the whole database.
RisenVids 2 years ago
Part 2: Generally your tutorials are not bad for beginners, but because they are for beginners you should take extra care that you teach the newbies how to use PHP correctly. Means proper input validation, correct escape methods, and so on. For the register script, username and email column in the DB should be UNIQUE to avoid to have more than one account with the same user name/login name.
Anyway, keep up your good work. :)
RisenVids 2 years ago
Thanks for lot without PHP Tutorial
TheFos23 2 years ago
in activate.php
the $code variable should also be filtered with addslashes() for security.
qabandiman 2 years ago 9
Oh yeah, forgot to say that you could better use a session ID as number, this will avoid activation problems.
nickvth2009 2 years ago
Hi i did similar script and I used the time() function (at the time of registration) for the conformation code,
ludmil1 2 years ago
Amazing contribution to the web development community!
xiz90 2 years ago
Totally agree with you here!
Alex you have saved 'my' technologically inclined life xD !
Thank you!! ^_^
cutieyuffie 2 years ago
thanks for this vid
alex please..Do you have any idea about regular expression?
we need it :(
thanks again ..
okNotImportant 2 years ago
okNotImportant i agree with u we need a tutorial about regular expressions :D
nice tutorial again alex
stategamer 2 years ago