在WordPress网站中,使用http_get函数从“上载/滑块”文件夹中获取了一些数据。但是,函数中提供的URL是“ ws / slider / list”,而不是“ upload / slider”。
现在,该应用程序已迁移到另一台服务器,即使上载/滑块文件夹中存在数据,http_get代码也会返回404。在任何地方都必须设置路由逻辑吗?PS:我没有WordPress经验。
我希望以HTML格式发送电子邮件,在此电子邮件中我需要从php表单传递数据.电子邮件作为html电子邮件成功发送,但不显示从PHP VARIABLE传递的数据.
$name = "PHP TEXT";
$headers = "From: " ."mail@example.com" . "\r\n";
$headers .= "Reply-To: ". "mail@example.com" . "\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$message = "<html><body><h1>HTML TEXT <?php echo $name; ?></h1></body></html>";
$email_to = 'example@mail.com'; //the address to which the email will be sent
$subject = "test";
$email = "example@mail.com";
if (mail($email_to, $subject, $message, $headers)) {
echo 'sent'; // success
} else {
echo 'failed'; // failure
}
Run Code Online (Sandbox Code Playgroud)