duandingqi9442 2011-06-05 22:06
浏览 32

我可以使用SSL加密PHP中提交的表单数据吗?

if i bough SSL Certificate for my site, can i encrypt submitted form data manually in PHP then store it to database?

Please Explain me what ssl does?

Example:

visitor of the site enter username and password, can i encrypt both data in php by using SSL?

like this.

$u_name = verisign_ssl_encryption($_POST['username']);
$pass = verisign_ssl_encryption($_POST['password']);

mysql_query('insert into table (username,password) values ("'.$u_name.'", "'.$pass.'")';

and can i decrypt retrieved encrypted data from table by using same SSL like this

$row = mysql_fetch_array(mysql_query('select * from table where u_id = 1'));
$user_card_no = verisign_ssl_decrypt($row['card_no']);
echo $user_card_no;

or SSL is something different from like this?

Advance thanks for your answers!

  • 写回答

4条回答 默认 最新

  • duanen19871021 2011-06-05 22:08
    关注

    SSL can be used in many ways, but I think the way you mean you will need ssl support for your website. With apache you can do this with modssl http://www.modssl.org/.

    You should consult with your hosting provider to configure your website with ssl support.

    评论

报告相同问题?

悬赏问题

  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?
  • ¥15 matlab(相关搜索:紧聚焦)
  • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计
  • ¥15 Arduino无法同时连接多个hx711模块,如何解决?
  • ¥50 需求一个up主付费课程
  • ¥20 模型在y分布之外的数据上预测能力不好如何解决