如何制作一个 'report' 按钮来发送消息而不通过电子邮件?
How can I make a 'report' button to send a message without going through email?
我正在寻找的正是一个按钮,上面写着类似 "Report a typo," 的内容,并在有人点击该页面上的该按钮时通知我。
澄清一下,我有一个包含许多短页的大型写作项目 -- 每个 html 模板中有几段,我知道可以做得更简洁,但这是另一回事。如果在通读时,每次我(或任何正在阅读的人)看到一些古怪的东西时,我只需单击一个按钮,然后收到一条消息,说明在哪个页面上单击了该按钮,而无需发送电子邮件,这将对我有帮助。我可以自动向我的电子邮件发送消息(甚至就像页面名称一样简单,例如正文中的 'example.html'),但我不想打开我的电子邮件客户端等。老实说,我可以通过任何方式获得通知(html5 可以发送信鸽吗?),只要用户交互保持最少即可。有没有相对简单的方法来做到这一点?我很高兴学习,但还不是专家。
如果我不清楚,如果之前有人问过这个问题(我真的想不出如何搜索我要问的内容),或者答案简单得离谱而且我只是完全错过了它。我对这一切有点菜鸟,所以如果这不是一个理想的问题,我很感激任何耐心,但我会尝试使用建议的修复进行更新。谢谢!
在 Html5 中不可能做到这一点,但是可以使用 Jquery 或 php 来完成,因为您可能需要一些后端站点脚本语言。
if ($this->form_validation->run() == FALSE) {
$this->load->view('welcome_message');
} else {
$this->load->view('formsuccess');
$name = $this->input->post('name');
$email = $this->input->post('email');
$cell = $this->input->post('cell');
$msg = $this->input->post('msg');
// $captcha=$this->input->post('captcha');
// echo $this->session->flashdata('email_sent');
$data = array('name' => $name, 'email' => $email, 'cell' => $cell, 'msg' => $msg);
$this->load->model('mymodel');
if ($this->mymodel->add($data)) {
$this->load->library('email');
//SMTP & mail configuration
$config = array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 465,
'smtp_user' => 'consecutive.development@gmail.com',
'smtp_pass' => 'devAccountCB!',
'mailtype' => 'html',
'charset' => 'utf-8'
);
$this->email->initialize($config);
$this->email->set_mailtype("html");
$this->email->set_newline("\r\n");
//Email content
$subject = 'Call Back Request';
$message = $this->input->post('msg');
$name = $this->input->post('name');
$from = $this->input->post('email');
$to = 'consecutive.development@gmail.com';
$this->email->from($from, $name);
$this->email->to($to);
$this->email->subject($subject);
$this->email->message("From : " . $from . " <br> Message: " . $message . "<br>Phone Number:" . $cell);
if ($this->email->send()) {
$this->mymodel->add($data);
$this->session->set_flashdata('success_msg', 'Message sent successfully');
//$success= $this->session->set_flashdata('success_msg');
} else {
$this->session->set_flashdata('error_msg', 'Error sending message!');
//redirect('Welcome/index');
// show_error($this->email->print_debugger());
}
echo '<script>alert("Your Message has been sent. Thankyou!");</script>';
redirect('');
我正在寻找的正是一个按钮,上面写着类似 "Report a typo," 的内容,并在有人点击该页面上的该按钮时通知我。
澄清一下,我有一个包含许多短页的大型写作项目 -- 每个 html 模板中有几段,我知道可以做得更简洁,但这是另一回事。如果在通读时,每次我(或任何正在阅读的人)看到一些古怪的东西时,我只需单击一个按钮,然后收到一条消息,说明在哪个页面上单击了该按钮,而无需发送电子邮件,这将对我有帮助。我可以自动向我的电子邮件发送消息(甚至就像页面名称一样简单,例如正文中的 'example.html'),但我不想打开我的电子邮件客户端等。老实说,我可以通过任何方式获得通知(html5 可以发送信鸽吗?),只要用户交互保持最少即可。有没有相对简单的方法来做到这一点?我很高兴学习,但还不是专家。
如果我不清楚,如果之前有人问过这个问题(我真的想不出如何搜索我要问的内容),或者答案简单得离谱而且我只是完全错过了它。我对这一切有点菜鸟,所以如果这不是一个理想的问题,我很感激任何耐心,但我会尝试使用建议的修复进行更新。谢谢!
在 Html5 中不可能做到这一点,但是可以使用 Jquery 或 php 来完成,因为您可能需要一些后端站点脚本语言。
if ($this->form_validation->run() == FALSE) {
$this->load->view('welcome_message');
} else {
$this->load->view('formsuccess');
$name = $this->input->post('name');
$email = $this->input->post('email');
$cell = $this->input->post('cell');
$msg = $this->input->post('msg');
// $captcha=$this->input->post('captcha');
// echo $this->session->flashdata('email_sent');
$data = array('name' => $name, 'email' => $email, 'cell' => $cell, 'msg' => $msg);
$this->load->model('mymodel');
if ($this->mymodel->add($data)) {
$this->load->library('email');
//SMTP & mail configuration
$config = array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 465,
'smtp_user' => 'consecutive.development@gmail.com',
'smtp_pass' => 'devAccountCB!',
'mailtype' => 'html',
'charset' => 'utf-8'
);
$this->email->initialize($config);
$this->email->set_mailtype("html");
$this->email->set_newline("\r\n");
//Email content
$subject = 'Call Back Request';
$message = $this->input->post('msg');
$name = $this->input->post('name');
$from = $this->input->post('email');
$to = 'consecutive.development@gmail.com';
$this->email->from($from, $name);
$this->email->to($to);
$this->email->subject($subject);
$this->email->message("From : " . $from . " <br> Message: " . $message . "<br>Phone Number:" . $cell);
if ($this->email->send()) {
$this->mymodel->add($data);
$this->session->set_flashdata('success_msg', 'Message sent successfully');
//$success= $this->session->set_flashdata('success_msg');
} else {
$this->session->set_flashdata('error_msg', 'Error sending message!');
//redirect('Welcome/index');
// show_error($this->email->print_debugger()); }
echo '<script>alert("Your Message has been sent. Thankyou!");</script>';
redirect('');