Jump to content

[SOLVED] strlen()


wrathican

Recommended Posts

i have a problem while using this.

i have a user registration form and im checking to see if the password is 6 or more characters long. this is what im using:

$passlen = strlen($password);

if ((checkString($password) == true) || ($passlen <= 5)) {
	$_SESSION['errorstate'] = 1;
	$errorarray[] = "Password is invalid";
}

if ($_SESSION['errorstate'] == 1) {
	$_SESSION['errormessage'] = $errorarray;
	header('location: ../register.php');
}

 

it doesnt seem to be setting the session and there fore not redirecting accordingly. any idea why?

Link to comment
https://forums.phpfreaks.com/topic/101968-solved-strlen/
Share on other sites

Last one, then I'm off to bed. Honestly.........

<?php

$passlen = strlen($password);

if (checkString($password) == true || $passlen <= 5 ){
	$_SESSION['errorstate'] = 1;
	$errorarray[] = "Password is invalid";
}

if ($_SESSION['errorstate'] == 1) {
	$_SESSION['errormessage'] = $errorarray;
	header('location: ../register.php');
}

Link to comment
https://forums.phpfreaks.com/topic/101968-solved-strlen/#findComment-521849
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.