doutan1875 2018-12-22 19:20
浏览 77

如何将表单数据提交到另一个网站以检索数据

I am developing a website about educational results in which my visitors can check different educational institute results by entering their roll no. The problem is when my visitor clicks the submit button he/she redirects to the institute's webpage where he/she can find his/her result. I want to show results on my website. When visitor clicks the submit button my form submits to external website grabs data from their database and display back to my webpage.

I tried the following code: You can check this page to better understand my problem: http://www.results.doyouknow.com.pk/5th-class-results-online/

<form id="result_form" class="form account-form" action="http://results.pec.edu.pk/" method="POST" target="_blank">
    <h1 style="font-size: 28px;">5th Class Result 2019</h1>
    <p style="clear: both; font-weight: bold; width: 100%; line-height: 40px;">Enter Grade 5 Roll No</p>

    <div style="width: 100%;">
        <div style="width: 23%; float: left;"><input id="roll_no" class="form-control" tabindex="" maxlength="2" name="roll_no1" type="number" placeholder="00" /></div>
        <div style="width: 23%; float: left;"><input id="roll_no" class="form-control" tabindex="" maxlength="3" name="roll_no2" type="number" placeholder="000" /></div>
        <div style="width: 23%; float: left;"><input id="roll_no" class="form-control" tabindex="" maxlength="3" name="roll_no3" type="number" placeholder="000" /></div>
        <div style="width: 23%; float: left;"><button class="button-5th" name="search">Search</button></div>
        <div style="clear: both;"></div>
    </div>
</form>

I want to submit form values to results website grab data from their database and display it back to my website.

</div>
  • 写回答

2条回答 默认 最新

  • douxing6434 2018-12-22 19:27
    关注

    You can use file_get_contents or curl to get content of required website. You can show result on your web page as it is or you can use simple html dom parser to fetch the required data.

    You can also use RSS and APIs if provided by website to access your required data.

    评论

报告相同问题?

悬赏问题

  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?