0
私はmagentoで新しいアカウントを作成するためにこの関数を書いたが、アラビア語を書くとエンコードされたデータを送信し、デコードするためにURLがエンコードされて送信される。そして、それはPOST` `このPHPで変数をデコードする
%D9%85%D8%AD%D9%85%D8%AF %D8%B5%D8%A7%D8%A8%D8%B1
元の単語[ محمد صابر ]
function register($email , $password , $firstname , $lastname )
{
$customer = Mage::getModel('customer/customer');
$customer->setWebsiteId(Mage::app()->getWebsite()->getId());
$customer->loadByEmail($email);
if(!$customer->getId()) {
$customer->setEmail(utf8_decode($email));
$customer->setFirstname(utf8_decode($firstname));
$customer->setLastname(utf8_decode($lastname));
$customer->setPassword(utf8_decode($password));
try {
$customer->save();
$customer->setConfirmation(null);
$response["success"] = 1;
}
catch (Exception $ex) {
$response["success"] = 0;
}
}
else{
$response["success"] = 0;
}
header('Content-Type: application/json; charset=utf-8');
return json_encode($response);
}
変更フォームメソッドのような符号化データを持つアカウントを作成し、それはあなたがより多くを送るよう勧めします小さいテキストだけではありません。 –