Jump to content

ephbaum

New Members
  • Posts

    2
  • Joined

  • Last visited

ephbaum's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. $rules_array = array( 'firstName'=>array('type'=>'string', 'required'=>true, 'min'=>2, 'max'=>30), 'lastName'=>array('type'=>'string', 'required'=>true, 'min'=>2, 'max'=>30), 'postcode'=>array('type'=>'string', 'required'=>true, 'min'=>5, 'max'=>10), 'profileText'=>array('type'=>'string', 'required'=>true, 'min'=>5, 'max'=>350) ); The last line was missing min and was written like this: 'profileText'=>array('type'=>'string', 'required'=>false, 'max'=>350) I changed it to true and added the min back in. The profile text isn't required so how would I write it to not be required? It cleared those 2 errors, now I'm getting error2. Now off to see if I can figure these out. Thanks a ton for your help!
  2. I"m getting two errors. I am not a programmer. Can usually grind it out the hard way but not getting anywhere with this one. Notice: Undefined index: min in /phpvalidation.php on line 100 case 'string': $this->validateString($var, $opt['min'], $opt['max'], $opt['required']); <LINE 100 if(!array_key_exists($var, $this->errors)) { $this->sanitizeString($var); } Warning: Cannot modify header information - headers already sent by (output started at /phpvalidation.php:100) in /doeditprofile.php on line 53 $publicOrNot = true; if($_POST['publicProfile'] == "false") { $publicOrNot = false; } $dbhandle = new mysqli("localhost", "XXXXXX_website", "2dc57pdgHxtLWfAQ", "XXXXXX_archivemain") or die("Unable to connect to MySQL"); $updateStatement = $dbhandle->prepare("UPDATE users SET firstName=?, lastName=?, postcode=?, profileText=?") or die("errorUP"); $updateStatement->bind_param('ssss', $_POST['firstName'], $_POST['lastName'], $_POST['postcode'], $_POST['profileText']) or die("errorDO"); $result = $updateStatement->execute() or die("error 3"); header('location: profile.php'); <LINE 53 } I don't get how 'min' is undefined. Was getting a bunch of 'undefined''s but solved that with isset. I'm lost.
×
×
  • 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.