运行此代码时出现错误:
import sqlite3
user_name = raw_input("Please enter the name: ")
user_email = raw_input("Please enter the email: ")
db = sqlite3.connect("customer")
cursor=db.cursor()
sql = """INSERT INTO customer
(name, email) VALUES (?,?);,
(user_name, user_email)"""
cursor.execute(sql)
Run Code Online (Sandbox Code Playgroud)
为什么会这样?
我想通过电子邮件发送给我后重定向用户.
代码运行,除非我在email()-method 之后放了一些东西(比如header()-method).
任何提示?
function process()
{
$msg = "Form Contents: \n\n";
foreach($this->fields as $key => $field)
$msg .= "$key : $field \n";
$to = 'mymail@gmail.com';
$subject = 'thesubject';
$from = $this->fields['email'];
mail($to, $subject, $msg, "From: $from\r\nReply-To: $from\r\nReturn-Path: $from\r\n");
header('Location: thanks.html');
}
Run Code Online (Sandbox Code Playgroud)