简体   繁体   English

用Python混合PHP和Sql

[英]Mixing Php and Sql with Python

I'm making a sample page with php, and it's respective database with MySQL, In it, I ask for the user to insert the password and some other data(name, email...), I wan't to encrypt the password. 我正在用php创建一个示例页面,并且它是使用MySQL的相应数据库,在其中,我要求用户插入密码和其他一些数据(名称,电子邮件...),我不想对密码进行加密。 I have the algorithm in a .Py file I made before, so I want to in some way insert it or make it work with the php so the password is revieved but not stored untill it is encrypted, and the so. 我在之前制作的.Py文件中有算法,因此我想以某种方式插入它或使其与php一起使用,以便重新显示密码,但直到加密后才存储密码,依此类推。 Can I mix my files so it happen? 我可以混合文件吗? I've heard of Python-Sql but I am not pretty sure it'll work. 我听说过Python-Sql,但是我不确定它是否可以正常工作。

Sure, you could use the exec function or just put a shell command in these little backtick things `` 当然,您可以使用exec函数或只是将shell命令放在这些反引号中,``

$password = `command to run python script here...`;

however, that's really overkill. 但是,那真的太过分了。 Write it in PHP or use stuff that already exists like md5() 用PHP编写它或使用像md5()这样已经存在的东西

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM