从登录表单到服务器的Http请求,没有在php中篡改参数 [英] Http request from login form to server without tamper of parameters in php

查看:63
本文介绍了从登录表单到服务器的Http请求,没有在php中篡改参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,



如何安全地从浏览器发送请求到我的web服务,例如:如果我想验证想要登录我的电子邮件和密码site.User现在提供他的emailid和密码我不希望任何人篡改用户在登录时发送的emailid和密码。



我希望这封电子邮件和密码不会在浏览器中显示为带参数的查询字符串。



例如,当我说提交登录表单时,我的浏览器显示



http://localhost/myapp/Login.php?emailid=abc@gmail.com&password=abc



有没有办法以安全的方式将此参数发送到服务器....

解决方案





试试这个:



您的提交表格:

 <  表格    action   =  http:// localhost / myapp / Login.php    方法  =  post    >  
电子邮件ID:< 输入 类型 = text name = emailid id = emailid / > < br / >
密码:< 输入 type = password name = 密码 id = 密码 / > < br / >
< 输入 类型 = submi t value = 登录 / >
< / form < span class =code-keyword>>



现在,在Login.php中,您可以使用 <获取值/ blockquote>

_POST

http://php.net/manual/en/reserved.variables.post.php [ ^ ]

http://www.w3schools.com/php/php_post.asp [ ^ ]

 <?php  


emailid =


Hi Friends,

How to send a request to my webservice in php from browser securely eg: if i want to authenticate emailid and password who wants to login my site.User provide his emailid and password now I dont want any one to tamper my emailid amd password that user has send while login.

I want this emailid and password not to be seen in browser as a query string with parameters.

eg when i say submit to login form my browser shows

http://localhost/myapp/Login.php?emailid=abc@gmail.com&password=abc

Is there any way to send this parameters to server in secure way to server....

解决方案

Hi,

Try this:

Your submit form:

<form action="http://localhost/myapp/Login.php" method="post">
Email ID: <input type="text" name="emailid" id="emailid" /><br />
Password: <input type="password" name="password" id="password" /><br />
<input type="submit" value="Log in" />
</form>


Now, in Login.php, you can get the values using


_POST:
http://php.net/manual/en/reserved.variables.post.php[^]
http://www.w3schools.com/php/php_post.asp[^]

<?php


emailid =


这篇关于从登录表单到服务器的Http请求,没有在php中篡改参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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