duanjia3187 2013-03-08 14:47
浏览 99

如何将POST数据发送到外部框架中的外部页面?

I have problems managing to do what I explained in the title. I was wondering if anyone could help me.

So I will explain it again in more detail:

I have a webpage which contains a form which sends POST data to an external URL(not mysite.com but hissite.com, I hope you got the idea) I used a HTML frame to create a page inside my own website (such as mysite.com/hissite) in order to hide the actual URL of the other website. The problem is that I am not able to pass the form input to hissite.com but through the frame inside my website.

I basically want the following: 1. The user logins on my website. 2. My login form passes the login information to the other website. 3. The user is logged in but instead to be redirected to the other website he is redirected to the frame inside my website which contains the other website.

I do not know how to explain it better, but I hope someone will understand me and help me to finish my project.

I have to mention that the form on my webpage has the same structure(fields, fields names etc) as the form on the other website. So I believed it would be super easy to pass the input through the frame. Well,... I realised it isn't that easy.

Here is the form:

<form action="/home/signin" method="post" name="loginForm" class="large-form" id="loginForm" >
  <fieldset>
    <label for="username">Username</label>
    <input type="text" name="username" tabindex="1" id="username" value="" />
</fieldset>
<fieldset>
  <label for="password">Password</label>
  <input type="password" name="password" tabindex="2" id="password" value="" />
  <input type="hidden" name="themeName" value=""/>
</fieldset>
<br/>
<div id="login-button">
  <input type="submit" value="Log In" tabindex="3" />
</div>

Thank you in advance for your help.

  • 写回答

2条回答 默认 最新

  • doumao1917 2013-03-08 15:03
    关注

    In this case you need to use ajax call, you send the information that you want to the other page and then you can carry on processing the data as you want, simply put a call on form submission as javaScript like:

    $.ajax({
            url: siteUrl,
            type: "post",
            async:true,
            dataType: 'json',
            success: function(data){
    your function
            },
            error: function(e){
    your error function
            }
        });
    
    评论

报告相同问题?

悬赏问题

  • ¥15 php 将rtmp协议转hls协议,无法播放
  • ¥15 miniconda安装不了
  • ¥20 python代码编写
  • ¥20 使用MPI广播数据遇到阻塞
  • ¥15 TinyMCE如何去掉自动弹出的“链接…”工具?
  • ¥15 微信支付转账凭证,如何解决
  • ¥15 在win10下使用指纹登录时,界面上的文字最后一个字产生换行现象
  • ¥20 使用AT89C51微控制器和MAX7219驱动器来实现0到99秒的秒表计数,有开始和暂停以及复位功能,下面有仿真图,请根据仿真图来设计c语言程序
  • ¥15 51单片机 双路ad同步采样
  • ¥15 使用xdocreport 生成word