funelephant wrote:
I want to create a login/registering process on a website I'm working on, but I don't know how to
Can I have any help?
I can't be bothered to write out a long piece of code so I'll just write the steps and let you work out the code
1) Provide a form, containing username, password, etc.
2) Validate form, check the passwords match, etc. (the entered values will be in the $_POST array, with the keys being the name of the element
3) If everything is okay, connect to database and insert the values, else, display errors in a <ul>, and go back to step 1
4) Set the $_SESSION variables accordingly ($_SESSION variables travel from page to page so you can use the data on all pages). Make sure to do session_start(); before using any of the $_SESSION variables
5) Enjoy the registration form you've just made
Do the same for the login form, basically, except for step 4 don't insert the values, just check whether they're correct (e.g. whether there's a user with that password). Make sure to hash the passwords securely too
If you need account activation (where the user needs to go to a link sent to their email to activate their account, until then they won't have any priveleges) then I'd be happy to give it to you, it's quite complicated though
Offline
c:
Offline
slinger wrote:
Copying and pasting will do you no good. You should follow a whole HTML tutorial then learn about the canvas tag.
I just want a squar canvas......
Offline
Firedrake969 wrote:
slinger wrote:
Copying and pasting will do you no good. You should follow a whole HTML tutorial then learn about the canvas tag.
I just want a squar canvas......
Are exactly do you mean by "canvas"? I know there's a tag, but do you mean that? Describe what you want.
I think you mean, a container. These are divs, like this:
<div style="width: 100px; height: 100px;">Inside</div>
Last edited by BirdByte (2012-09-27 16:23:55)
Offline
[scratchblocks]
when gf clicked
forever
change color by (25)
think [people please make your sites good because they look interesting] for (2) secs
Offline
jontmy00 wrote:
Please do not block spam. You can just type it out in text without the need of the blocks.
+1
Offline
I'm working on codeacademy and this is probably a stupid question, but what's wrong with my syntax here? The SyntaxError keeps giving me "errors" that if I corrected, would mess up the code. (Lesson is Functions in JavaScript: The lost numbers)
var isLost = function (n) { for (i=0, i<6, i++) { if ( n === lost[i]) { return; } } }
Last edited by soupoftomato (2012-09-28 10:35:57)
Offline
soupoftomato wrote:
I'm working on codeacademy and this is probably a stupid question, but what's wrong with my syntax here? The SyntaxError keeps giving me "errors" that if I corrected, would mess up the code. (Lesson is Functions in JavaScript: The lost numbers)
Code:
var isLost = function (n) { for (i=0, i<6, i++) { if ( n === lost[i]) { return; } } }
I'm not claiming to be an expert in JS so I wouldn't trust everything I say about it but I'm not sure if you can directly set a variable using a function in that way. I mean, I'd've thought you'd need to make the function first, then use a function call, if that makes sense
Also whatever happens, isLost would always be NULL, I think
EDIT; Oh wait, I spotted it. In the for loop, use semi-colons to separate the things, not commas. So,
for (i=0; i<6; i++)
not
for (i=0, i<6, i++)
Last edited by RedRocker227 (2012-09-28 10:54:58)
Offline
Ah, good job, Red. Got there before I could.
Yeah, I think that is probably the problem.
Offline
RedRocker227 wrote:
soupoftomato wrote:
I'm working on codeacademy and this is probably a stupid question, but what's wrong with my syntax here? The SyntaxError keeps giving me "errors" that if I corrected, would mess up the code. (Lesson is Functions in JavaScript: The lost numbers)
Code:
var isLost = function (n) { for (i=0, i<6, i++) { if ( n === lost[i]) { return; } } }I'm not claiming to be an expert in JS so I wouldn't trust everything I say about it but I'm not sure if you can directly set a variable using a function in that way. I mean, I'd've thought you'd need to make the function first, then use a function call, if that makes sense
Also whatever happens, isLost would always be NULL, I think
EDIT; Oh wait, I spotted it. In the for loop, use semi-colons to separate the things, not commas. So,
for (i=0; i<6; i++)
not
for (i=0, i<6, i++)
I declared the variable earlier but didn't copypaste it in to this thread.
However, thank you! I'm starting on the site again after a break so I forgot about needing semicolons there.
Also, that chunk isn't finished yet.
Last edited by soupoftomato (2012-09-28 10:58:51)
Offline
soupoftomato wrote:
RedRocker227 wrote:
soupoftomato wrote:
I'm working on codeacademy and this is probably a stupid question, but what's wrong with my syntax here? The SyntaxError keeps giving me "errors" that if I corrected, would mess up the code. (Lesson is Functions in JavaScript: The lost numbers)
Code:
var isLost = function (n) { for (i=0, i<6, i++) { if ( n === lost[i]) { return; } } }I'm not claiming to be an expert in JS so I wouldn't trust everything I say about it but I'm not sure if you can directly set a variable using a function in that way. I mean, I'd've thought you'd need to make the function first, then use a function call, if that makes sense
Also whatever happens, isLost would always be NULL, I think
EDIT; Oh wait, I spotted it. In the for loop, use semi-colons to separate the things, not commas. So,
for (i=0; i<6; i++)
not
for (i=0, i<6, i++)I declared the variable earlier but didn't copypaste it in to this thread.
However, thank you! I'm starting on the site again after a break so I forgot about needing semicolons there.
Oh, okay
You're welcome
Offline
RedRocker227 wrote:
soupoftomato wrote:
RedRocker227 wrote:
I'm not claiming to be an expert in JS so I wouldn't trust everything I say about it but I'm not sure if you can directly set a variable using a function in that way. I mean, I'd've thought you'd need to make the function first, then use a function call, if that makes sense
Also whatever happens, isLost would always be NULL, I think
EDIT; Oh wait, I spotted it. In the for loop, use semi-colons to separate the things, not commas. So,
for (i=0; i<6; i++)
not
for (i=0, i<6, i++)I declared the variable earlier but didn't copypaste it in to this thread.
However, thank you! I'm starting on the site again after a break so I forgot about needing semicolons there.Oh, okay
You're welcome
Managed to pass with this:
var lost = [4, 8, 15, 16, 23, 42]; var count = lost.length; var isLost = function (n) { for (var i=0; i<6; i++) { if ( n === lost[i]) { return true; } } return false; }; if (isLost(12)) { console.log('12 is a lost number'); } if ( isLost(16) ) { console.log('16 is a lost number'); }
Offline
I feel exactly the same with my code most times. xD
Offline
ProgrammingFreak wrote:
I feel exactly the same with my code most times. xD
+1
When I learn javascript, the same thing will happen.
Offline
hey guys u dont need to code use the URL
http://kidswebsitecreator.com/#/build-a-site
Offline
PikachuXionLover wrote:
hey guys u dont need to code use the URL
http://kidswebsitecreator.com/#/build-a-site
*facepalm*
Hand coding outranks that stuff any day.
Offline
Is that like weebly?
Offline
Yes.
I agree with Gravitation
Offline
I'm making a website for myself, you can see my progress on gravi.tation.tk (Best viewed in Chrome or Safari, but works in others too)
Offline