|
| 29 May 2012 01:14 AM |
$confirmpass=$_POST['ConfirmPass']; if($_POST['pw']==$confirmpass){
Anyone see anything wrong with this? |
|
|
| Report Abuse |
|
|
|
| 29 May 2012 01:20 AM |
Looks good to me. Are you sure your inputs are equivalent, and that your values have the right names?
Haters gonn' hate. |
|
|
| Report Abuse |
|
|
| |
|
farted
|
  |
| Joined: 26 Feb 2008 |
| Total Posts: 358 |
|
|
| 29 May 2012 01:54 AM |
$confirmpass=$_POST['ConfirmPass']; if($_POST['pw']!=$confirmpass){
btw would advise using strip_tags and mysql_real_escape_string on your inputs |
|
|
| Report Abuse |
|
|
farted
|
  |
| Joined: 26 Feb 2008 |
| Total Posts: 358 |
|
|
| 29 May 2012 01:55 AM |
ohwait ohwait ohwait i would have borked your code, i would do it MY way of checking... :(
|
|
|
| Report Abuse |
|
|
farted
|
  |
| Joined: 26 Feb 2008 |
| Total Posts: 358 |
|
|
| 29 May 2012 01:58 AM |
if (strcmp($confirmpass, $_POST['pw']) == 0){ //code }
should work |
|
|
| Report Abuse |
|
|
|
| 29 May 2012 02:20 AM |
| strcmp stands for String Compare, not StringCheck. |
|
|
| Report Abuse |
|
|
farted
|
  |
| Joined: 26 Feb 2008 |
| Total Posts: 358 |
|
|
| 29 May 2012 02:39 AM |
@biker
if the strings match it returns 0, and i check if it equals 0
so... my way works |
|
|
| Report Abuse |
|
|
|
| 29 May 2012 02:59 AM |
That is a horrible way to do this....
Haters gonn' hate. |
|
|
| Report Abuse |
|
|
Phizo
|
  |
| Joined: 26 Jun 2009 |
| Total Posts: 269 |
|
|
| 29 May 2012 06:59 AM |
No one is going to provide anything useful, that code is totally incorrect. Firstly, never use GET for login credentials, use POST. Secondly, that code will not work for what you're trying to do. You may use this code as an example, or just copy and paste it and learn nothing. It's entirely up to you.
The PHP:
$confirm_pass = $_POST['ConfirmPass'];
if($confirm_pass == 'bikerking2000') // the pa$$w0rd is 'bikerking2000' without the single quotes. echo 'The pa$$w0rd is correct'; else echo 'The pa$$w0rd is incorrect.';
The HTML (the form for pa$$w0rd input) - REMOVE THE SPACES BETWEEN THE ARROWS OR IT WILL NOT WORK:
< html > < head > < title >p@$$w0rd checker< /title > < /head >
< body >
< form method="POST" > < input type="pa$$w0rd" name="ConfirmPass" / > < input type="submit" / > < /form >
< /body >
< /html > |
|
|
| Report Abuse |
|
|
Phizo
|
  |
| Joined: 26 Jun 2009 |
| Total Posts: 269 |
|
|
| 29 May 2012 07:29 AM |
| I forgot to say, remove p@$$w0rd and use the real word for it otherwise it won't work. |
|
|
| Report Abuse |
|
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
|
| 29 May 2012 07:47 AM |
>Firstly, never use GET for login credentials, use POST.
He _IS_ using POST derpppp |
|
|
| Report Abuse |
|
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
|
| 29 May 2012 07:48 AM |
>Secondly, that code will not work for what you're trying to do.
Do you even know what he is trying to do?
get out |
|
|
| Report Abuse |
|
|
Phizo
|
  |
| Joined: 26 Jun 2009 |
| Total Posts: 269 |
|
|
| 29 May 2012 07:53 AM |
I misread, I thought he was using $_GET. It's pretty obvious what he's trying to do.
Why are you trying to offend me? All I'm doing is answering a question. Don't tell me to 'get out' or try to anger me with your petty 'deeeerp'. Did I do anything to deserve it? I don't believe so. |
|
|
| Report Abuse |
|
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
|
| 29 May 2012 07:54 AM |
Ehhh...
Your code wouldn't do what he wanted..
You got it wrong. |
|
|
| Report Abuse |
|
|
Phizo
|
  |
| Joined: 26 Jun 2009 |
| Total Posts: 269 |
|
|
| 29 May 2012 07:58 AM |
No apology? Mature.
His code states he wants to assign $_POST['ConfirmPass'] to the variable $confirmpass, the superglobal $_POST is used for user input to be sent via a form behind the scenes. Then he wants to check that the input he uses matches the user input, which makes no sense. I believe he wishes to check the p@$$w0rd via user input, however he is doing it wrong.
If anything I believe it is you who is misunderstood. |
|
|
| Report Abuse |
|
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
|
| 29 May 2012 08:00 AM |
>His code states he wants to assign $_POST['ConfirmPass'] to the variable $confirmpass
No.. His code states he wants to check does ConfirmPass equal with $confirmpass..
DERPPPPPPPP |
|
|
| Report Abuse |
|
|
Phizo
|
  |
| Joined: 26 Jun 2009 |
| Total Posts: 269 |
|
|
| 29 May 2012 08:03 AM |
LOL. You are so dumb.
= is the assignment operator. == is to check if condition1 EQUAL TO condition2.
$confirmpass = $_POST['ConfirmPass'] -- ASSIGNING user input to the $confirmpass VARIABLE.
Go and research before attempting to out-talk me in programming. I know what I'm talking about.
|
|
|
| Report Abuse |
|
|
1Topcop
|
  |
| Joined: 09 Jun 2009 |
| Total Posts: 6635 |
|
|
| 29 May 2012 08:04 AM |
He was turning ConfirmPass into a variable. How do you know he's not going to use it farther on in the script? |
|
|
| Report Abuse |
|
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
|
| 29 May 2012 08:05 AM |
$confirmpass=$_POST['ConfirmPass']; --assigning it here and it works if($_POST['pw']==$confirmpass){ --checking here..
derpppp |
|
|
| Report Abuse |
|
|
1Topcop
|
  |
| Joined: 09 Jun 2009 |
| Total Posts: 6635 |
|
| |
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
|
| 29 May 2012 08:07 AM |
| He only has the problem with checking le values |
|
|
| Report Abuse |
|
|
Phizo
|
  |
| Joined: 26 Jun 2009 |
| Total Posts: 269 |
|
|
| 29 May 2012 08:08 AM |
I know what he's assigning and what he's checking, however that's the only code he provided and that's what I'm going off. Just that would not work, he would have to include a form for it to work.
My code did exactly what he was attempting to do, yet su8 has to get his post count up to feel leet. Hence the useless posts provided. |
|
|
| Report Abuse |
|
|
1Topcop
|
  |
| Joined: 09 Jun 2009 |
| Total Posts: 6635 |
|
|
| 29 May 2012 08:10 AM |
He was posting the lines that got the error message. For all you know there could be a 200 line code behind that.
|
|
|
| Report Abuse |
|
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
|
| 29 May 2012 08:10 AM |
biker: if($_POST['pw']==$confirmpass){ your response: His code states he wants to assign $_POST['ConfirmPass'] to the variable $confirmpass
isn't it your time to learn? |
|
|
| Report Abuse |
|
|