dongqin6926 2017-12-25 18:52
浏览 119


I am trying to make a contact form that opens a new window for confirmation, and from that window, it must open Outlook with the details that I filled in the form. I know that i must use some sort of encoding, but i just can't get it to work. I modified it from my code, with the actual code you start on contact.html, you type your details then you click submit and form.php opens that shows the data, and it has hidden input boxes that also have the data, so they can show in the mail using mailto. Image

My form.php code

<!DOCTYPE html>
    <meta charset="utf-8">
    <link rel="stylesheet" type="text/css" href="style.css">
    <form action="" method="post" enctype="x-www-form-urlencoded">
          <td><input id="name" type="text" name="name" value="Ύθιρτυθριςδ"></td>
          <td><input id="surname" type="text" name="surname" value="κσξγΙέκεε"></td>
          <td><input id="tel" type="text" name="tel" value="12345"></td>
          <td><input id="email" type="text" name="email" value=""></td>
          <td><input id="text" type="text" name="Request" value="ΑΒΓΔεζήθίκ"></td>
    <input type="submit" value="Send">

  • 写回答

1条回答 默认 最新

  • douhoulei4706 2017-12-25 21:27

    Your script to open an email currently works as follows:

    • you click the submit button with the target "mailto:"
    • the mail program opens
    • the email body gets filled with content of the URL (the URL parameters), hence the cryptic looking email body.

    To avoid that, I would suggest to outsource the sending part with a function. E.g. when a user clicks the submit button call the function to send an email and build the actual "link" like so: ""

    Of course you can use string concatenation to build the string, using the values of your form. That should do the trick.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?



  • ¥15 PdfiumViewer pdf转图片
  • ¥15 利用Java连接API接口总是出问题
  • ¥15 请教一个关于镜头标定,棋盘格格子大小的问题(畸变测试)
  • ¥15 el-table输入多维数组怎么实现
  • ¥15 安装GroudingDINO RuntimeError: Error compiling objects for extension
  • ¥15 关于推送项目到github的问题
  • ¥15 急!C++指针编写相关的问题
  • ¥15 kerberos身份认证配置问题
  • ¥30 用python写一个多签情况下波场的代理资源和回收资源
  • ¥15 matlab学期例题代码答疑