Postado Maio 9, 2015 10 anos Olá galera ajuda com este erro na hora de colocar o email quando cria conta no site mesmo digitando um email verdadeiro acontece este erro Strict Standards: Non-static method AAC::ValidEmail() should not be called statically in C:\xampp\htdocs\modules\account_create.php on line 11 <?php include ("../include.inc.php"); //retrieve post data $form = new Form('newaccount'); //check if any data was submited if ($form->exists()){ //image verification if ($form->validated()){ //email formating rules if (AAC::ValidEmail($form->attrs['email'])){ $account = new Account(); do $account->setAttr('accno', rand(100000,999999)); while ($account->exists()); //set account atrributes $accno = $account->getAttr('accno'); if ($form->attrs['password'] == $form->attrs['confirm'] && AAC::ValidPassword($form->attrs['password'])) $password = $form->attrs['password']; else $password = substr(str_shuffle('qwertyuipasdfhjklzxcvbnm123456789'), 0, 6); $account->setPassword($password); $account->setAttr('email',$form->attrs['email']); //create the account $account->save(); if ($cfg['Email_Validate']){ $body = "Here is your login information for <a href=\"http://$cfg[server_url]/\">$cfg[server_name]</a><br/> <b>Account number:</b> $accno<br/> <b>Password:</b> $password<br/> <br/>"; //send the email require("../phpmailer/class.phpmailer.php"); $mail = new PHPMailer(); $mail->IsSMTP(); $mail->IsHTML(true); $mail->Host = $cfg['SMTP_Host']; $mail->Port = $cfg['SMTP_Port']; $mail->SMTPAuth = $cfg['SMTP_Auth']; $mail->Username = $cfg['SMTP_User']; $mail->Password = $cfg['SMTP_Password']; $mail->From = $cfg['SMTP_From']; $mail->AddAddress($form->attrs['email']); $mail->Subject = $cfg['server_name'].' - Login Details'; $mail->Body = $body; if ($mail->Send()){ //create new message $msg = new IOBox('message'); $msg->addMsg('Your login details were emailed to '.$form->attrs['email']); $msg->addClose('Finish'); $msg->show(); }else $error = "Mailer Error: " . $mail->ErrorInfo; }else{ //create new message $msg = new IOBox('message'); $msg->addMsg('Please write down your login information:'); $msg->addInput('account','text',$accno,50,true); $msg->addInput('password','text',$password,50,true); $msg->addMsg('You can now login into your account and start creating characters.'); $msg->addClose('Finish'); $msg->show(); $account->logAction('Created'); } }else{ $error = "Bad email address";} }else{ $error = "Image verification failed";} if (!empty($error)){ //create new message $msg = new IOBox('message'); $msg->addMsg($error); $msg->addReload('<< Back'); $msg->addClose('OK'); $msg->show(); } }else{ //create new form $form = new IOBox('newaccount'); $form->target = $_SERVER['PHP_SELF']; $form->addLabel('Create Account'); $form->addInput('email'); $form->addInput('password','password'); $form->addInput('confirm','password'); $form->addCaptcha(); $form->addClose('Cancel'); $form->addSubmit('Next >>'); $form->show(); }?> Editado Maio 9, 2015 10 anos por Komic (veja o histórico de edições)
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.