使用预制 .exe 的网站输入/输出(需要指导)
我正在尝试构建网站的一部分,该网站接受文本段落作为输入,并输出相同的文本段落,但当用户滚动(或单击)任何给定单词时出现的每个单词的定义除外。我有一个预制的 .exe 文件,它将输入单词映射到它们的定义(从标准输入中获取单词并将定义输出到标准输出)。
那么,我的问题是通过网站服务器上的 .exe 文件运行用户输入,然后将输出放回到页面上。这似乎是一个相当微不足道的问题,但我不知道从哪里开始。
所以我的问题是:这个项目可能吗?如果是这样,我需要能够使用哪些语言/工具来实现它?是否有描述我正在谈论的内容的关键字,我可以使用这些关键字在网上查找教程/解决方案?
我对 PHP、HTML 和 Javascript 有基本的了解,但经验太少,以至于我无法判断它们是否(以及如何)可以用来解决这个问题。
注意:我无权访问 .exe 源代码,因此我必须使用 .exe 本身作为我的输入输出机制。
I am trying to build a part of a website which takes in a text passage as input, and outputs the same text passage, except with the definition of each word appearing when the user rolls over (or clicks) any given word. I have a pre-made .exe file which maps input words to their definitions (takes in words from standard input and outputs the definition to standard output).
My problem, then, is to run user input through the .exe file on the website's server, then put the output back onto the page. It seems like a fairly trivial problem, but I have no idea where to start.
So my questions are: is this project even possible? If so, what languages/tools do I need to be able to use in order to implement it? Are there keywords that describe what I'm talking about that I could use to look up tutorials/solutions on the Web?
I have rudimentary knowledge of PHP, HTML, and Javascript, but so little experience that I can't judge whether (and how) they can be used to approach this problem.
Note: I do not have access to the .exe source, so I must use the .exe itself as my input-output mechanism.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 AJAX 和 PHP,您可以轻松完成此任务。
JavaScript 的 AJAX 功能会将您输入的单词发送到 PHP 页面,并且从 PHP 页面,您可以使用发送的单词作为参数运行外部 exe 文件(请对其进行清理。人们可以注入会爆炸您的服务器的代码! ):
With AJAX and PHP, you can do accomplish this with minimal effort.
JavaScript's AJAX features would send the word you input to the PHP page, and from the PHP page, you can run the external exe file with the sent word as an argument (sanitize it, please. People can inject code which will explode your servers!):