dshfjsh_5455 2013-06-19 17:59
浏览 14

如何从$ POST向两个网站提交电子邮件

I have been searching the web for a similar question and have found none, Your help would be greatly appreciated. I have a webpage which takes a user's inputted email address, but i would like to submit it to two different forms, one of which I have no server access to. how should I proceed? I heard that Iframes can be used in this instance, but Im not entirely sure.

Thanks again.

-MDB

  • 写回答

1条回答 默认 最新

  • douna2014 2013-06-19 18:15
    关注

    The first form:

    <form name="Sendform" method="post" action="https://aaa.bbb.com/somthing" target="_blank" accept-charset="UTF-8">
    <input class="send_input" type="text" name="1" id="1" placeholder="name" />
    <img src="/images/sendBTN.png" onclick="Sendform.submit();submitForm();"/>
    </form>
    //Sendform.submit(); <-- sending it to the action url
    //submitForm(); <-- call a js function that will send another email
    

    The second one

    function submitForm()
    {
        var first = $("input#1.send_input").val();
        var redirect = 'http://localhost:8088';
        var action = 'http://localhost:8088/wp-login.php?action=register';
        var method = 'post';
        var params = {'first_name':first,'redirect_to':redirect};
    
        var form = document.createElement("form");
        form.setAttribute("method", method);
        form.setAttribute("action", action);    
        form.setAttribute("accept-charset","UTF-8");
        form.setAttribute("name", "registerform");
        form.setAttribute("id", "registerform");
        for(var key in params) {
            if(params.hasOwnProperty(key)) {
                var hiddenField = document.createElement("input");
                hiddenField.setAttribute("type", "hidden");
                hiddenField.setAttribute("name", key);          
                hiddenField.setAttribute("id", key);
                hiddenField.setAttribute("value", params[key]);
                form.appendChild(hiddenField);
             }
        }
        document.body.appendChild(form);
        form.submit();//<-- send the second email
    }
    
    评论

报告相同问题?

悬赏问题

  • ¥15 ogg dd trandata 报错
  • ¥15 高缺失率数据如何选择填充方式
  • ¥50 potsgresql15备份问题
  • ¥15 Mac系统vs code使用phpstudy如何配置debug来调试php
  • ¥15 目前主流的音乐软件,像网易云音乐,QQ音乐他们的前端和后台部分是用的什么技术实现的?求解!
  • ¥60 pb数据库修改与连接
  • ¥15 spss统计中二分类变量和有序变量的相关性分析可以用kendall相关分析吗?
  • ¥15 拟通过pc下指令到安卓系统,如果追求响应速度,尽可能无延迟,是不是用安卓模拟器会优于实体的安卓手机?如果是,可以快多少毫秒?
  • ¥20 神经网络Sequential name=sequential, built=False
  • ¥16 Qphython 用xlrd读取excel报错