做了一个简单的提交用户表格电子邮件和城市数据保存在数据库中,现在我需要在提交数据系统后添加这个表格在用户地址上生成自动电子邮件但是提到的变量我使用一个变量调用$lang如果用户输入是ar所以发送阿拉伯语的电子邮件或如果用户输入en所以用英语发送电子邮件,我面临两个问题,不知道如何在代码中修复此电子邮件类,以便我共享代码.
电子邮件类
public function email() {
$email = $this->input->post('email');
$city = $this->input->post('city');
$this->load->library('email');
$this->email->from('noreply@abc.com', 'Halalat');
$this->email->to('$emai');
$this->email->subject('Halalat Newsletter Subscription');
$this->email->message( 'Thankyou for submission' );
$this->email->send();
echo $this->email->print_debugger();
}
Run Code Online (Sandbox Code Playgroud)
控制器中的user.php
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class User extends CI_Controller {
function __construct() {
parent::__construct();
$this->load->helper('form');
$this->load->helper('url');
$this->load->library('user_agent');
$this->load->library('form_validation');
}
public function create_user() {
// field name, error message, validation rules
$lang = $this->input->post("lang");
$this->form_validation->set_rules('email', 'Email', 'trim|required|valid_email|is_unique[users.email]');
$this->form_validation->set_rules('city', 'City', 'trim|required');
if ($this->form_validation->run() == …Run Code Online (Sandbox Code Playgroud) 我正在研究magento和magento的新品我使用了很多模板现在我正在研究Magento经典主题,我谷歌很多人说基础默认可能会有变化我会去那里和login.phtml文件删除代码当我刷新在模板上没有什么可以消失的一切都是一样的
C:\ WAMP\WWW\Magento的\ APP \设计\前台\基地\ DEFAULT \模板\用户\形式
然后我将尝试在主模板文件夹中的主模板文件上工作,但仍然没有变化现在我完全混淆如何解决这个问题以及如何根据自己的选择编辑客户登录页面
C:\ WAMP\WWW\Magento的\ APP \设计\前台\ DEFAULT\F002 \模板
我需要你的建议和指导,请帮我解决这个问题.
做了一个简单的订阅表单提交电子邮件和城市唯一的电子邮件ID我设置唯一,但如果电子邮件ID已经在数据库中它显示错误我需要在这里添加警报,如果已经在数据库中的数据提醒用户,但没有显示这样的完整细节.
发生数据库错误
错误号码:1062
键2的重复条目'abc @ abc'
INSERT INTO
users(city)VALUES('abdullah @ gaya.com','jeddah')文件名:/home/content/f/a/h/fahadghafoor/html/fahad/models/users_model.php
行号:12
模型文件user_model.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Users_model extends CI_Model
{
function create_member()
{
$new_member_insert_data = array(
'email' => $this->input->post('email'),
'city' => $this->input->post('city'),
);
$insert = $this->db->insert('users', $new_member_insert_data);
return $insert;
}//create_member
}
Run Code Online (Sandbox Code Playgroud)
控制器文件user.php
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class User extends CI_Controller {
function __construct() {
parent::__construct();
$this->load->helper('form');
$this->load->helper('url');
$this->load->library('user_agent');
$this->load->library('form_validation');
}
public function …Run Code Online (Sandbox Code Playgroud)