Jump to content

One Password, no MySQL


Lamez

Recommended Posts

I am trying to have a sign up code on my website, this will allow the user to sign up, only permitted users will have the code.

 

Well I have been racking my brain on how to do this.

 

I want to set the password through the php script, this is what I have so far:

 

	  else{
      $code = "testcode";
      if ($_POST['code'] != $code {$form->setError($field, "* Invaild Code"); }

  }

 

but it does not work, what am I doing wrong? User still can sign up.

Link to comment
https://forums.phpfreaks.com/topic/85311-one-password-no-mysql/
Share on other sites

alright I have changed up the code a bit, just variables really.

 

but now I get the error * Code not entered

 

here is the whole code checking:

      $field = "code";  //Use field name for code
      if(!$code || strlen($subcode = trim($code )) == 0){
      $form->setError($field, "* Code not entered");
      }
      else{
       $ncode = "testcode";
       if ($code != $ncode) {
      $form->setError($field, "* Invaild Code"); 
      }

Link to comment
https://forums.phpfreaks.com/topic/85311-one-password-no-mysql/#findComment-435304
Share on other sites

So is this part of the code:

      $field = "code";  //Use field name for code
      if(!$code || strlen($subcode = trim($code )) == 0){
      $form->setError($field, "* Code not entered");
      }
      else{
       $ncode = "testcode";
       if ($code != $ncode) {
      $form->setError($field, "* Invaild Code"); 
      }

in a function? If so, can you post the entire function?

Link to comment
https://forums.phpfreaks.com/topic/85311-one-password-no-mysql/#findComment-436098
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.