隐藏源代码中的输入值 [英] Hide input values from source code

查看:131
本文介绍了隐藏源代码中的输入值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了一个非常简单的API和HTML参数,但我想隐藏(从源代码)某些字段的值(如API用户名和密码),并隐藏表单操作值(显示为

代码示例:

   < form name =testaction =https://test.com/api.phpmethod =post> 
< input name =usertype =hiddenvalue =test>
< input name =passwordtype =hiddenvalue =test>
< input type =submitvalue =发送>
< / form>

有什么想法?

在PHP文件中的值?

解决方案

您必须创建一个PHP动作文件,将您的表单重定向到这个PHP文件,建立用户和密码字段并使用curl从PHP发布数据并从其他API获取数据。


I'm using a very simple API with HTML parameters but I would like to hide (from the source code) the values from certain fields (like API username and password) and also to hide the form action value (that appears as a link on the Submit button).

Code example:

<form name="test" action="https://test.com/api.php" method="post">
<input name="user" type="hidden" value="test">
<input name="password" type="hidden" value="test">
<input type="submit" value="Send">
</form>

Any ideas?

Maybe adding the values in a php file?

解决方案

You would have to create a PHP action file, redirect your form to this PHP file, fill up the user and password fields and use curl to post data from PHP and get data back from the other API .

这篇关于隐藏源代码中的输入值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆