小编Twe*_*eak的帖子

更改附件名称:wp_mail PHP

我正在使用 wp_mail 通过我网站上的表单发送邮件。但是当我附加一些文件时,名称类似于“phpr0vAqT”或“phpFO0ZoT”。

$files = array(); //Array pour les fichiers
$count = count(array_filter($_FILES['fichier']['name'])); //Compte le nombre de fichiers

        for($i=0;$i<$count;$i++){ //boucle sur chaque fichier

            array_push($files, $_FILES['fichier']['tmp_name'][$i]); //insere le fichier dans l'array $files

         }
Run Code Online (Sandbox Code Playgroud)

我认为问题来自: ['tmp_name'] ,但我不知道我可以更改什么,因为 wp_mail 需要路径。

然后,我正在这样做:

wp_mail($to, $subject, $message, $headers, $files);
Run Code Online (Sandbox Code Playgroud)

发送邮件。

谢谢。

php email wordpress attachment names

4
推荐指数
2
解决办法
3015
查看次数

验证reCaptcha V2:始终为false

我正在尝试在我的网站(用PHP和Wordpress开发)中植入Google的reCaptcha V2。

我正在尝试验证用户是否在提交之前检查了此验证码。

这是我的验证:

<?php

if(isset($_POST['g-recaptcha-response']) && !empty($_POST['g-recaptcha-response'])){
  $privatekey = $secret;
  $captcha = $_POST['g-recaptcha-response'];
  $url = 'https://www.google.com/recaptcha/api/siteverify';
  $data = array(
      'secret' => $privatekey,
      'response' => $captcha,
      'remoteip' => $_SERVER['REMOTE_ADDR']
  );

  $curlConfig = array(
      CURLOPT_URL => $url,
      CURLOPT_POST => true,
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_POSTFIELDS => $data
  );

  $ch = curl_init();
  curl_setopt_array($ch, $curlConfig);
  $response = curl_exec($ch);
  curl_close($ch);
  $jsonResponse = json_decode($response);
  if ($jsonResponse->success == true) {
            $succMsg = 'Your contact request have submitted successfully.';
            echo "<script>alert(\"OK\")</script>";
  }
  else {
      $errMsg = 'Robot verification …
Run Code Online (Sandbox Code Playgroud)

php wordpress verification captcha

2
推荐指数
1
解决办法
2487
查看次数

用 Coq 中的列表证明

我试图在 CoqIDE(学校)中证明一些东西。我挡住了一步,这是

`Print length. (* la longueur de listes *)


Lemma mystere A:  forall l : list A, length l = 0 <-> l = nil.
intros.
destruct l.
* split.
- intros.
reflexivity.
- intros. 
simpl.
reflexivity.
* split.
- intros.
???? <- I have tried many things, but without success..
Admitted.
`
Run Code Online (Sandbox Code Playgroud)

谢谢各位的考虑!

math list coq

1
推荐指数
1
解决办法
160
查看次数

标签 统计

php ×2

wordpress ×2

attachment ×1

captcha ×1

coq ×1

email ×1

list ×1

math ×1

names ×1

verification ×1