数据:PHP形式=>电子邮件=> Access 2007 数据库
我有一个提交到 PHP 页面的表单。表单中的数据需要添加到 Access 数据库中,但是该网站是托管的并且 Access 数据库位于网络驱动器上。因此,目前该表单只是将数据通过电子邮件发送给手动输入的人员。我们正在努力改进这个流程。
所以PHP页面没有办法直接访问.mdb文件。
我的想法是让 PHP 页面以某种方式创建一个编码数据块,可能隐藏在其中的校验和,并将其通过电子邮件发送给我们的数据输入人员。这封电子邮件看起来像这样:
===== BEGIN FORM DATA =====
oipcxunrhunt5klejswtnlerj,m,nxupogxjidoh
jpos89760aq2y984hu5nw3jnm4tiopanj5kjny;s
ljknm;l5nkl;ksnm;linjtg89jx9070g89xc6dgh
890unysl;ne.lmsjo8r7g9n0cf9ogumhlkod9ysd
8hj7pc9pg8uopcfmity68od7r9pyh9pm9pfghpju
ypxdekopslp4mpsmkl;4m;slkmk;smjilenmuops
inuobnuiou5io5nuosiun5oin5u4oinu5oiwnu3o
in2oinounion0uonio76n598n109yb9705btbsnb
===== END FORM DATA =====
我想到了 UUencoding,但实际上我想我只需要某种易于在 PHP 和 Access (VBScript) 中实现的加密算法。
当然,最后一部分是在 Access 输入表单上有一个按钮。该按钮将弹出一个文本框,数据输入人员只需将上述文本块粘贴到框中并单击“确定”,一些宏代码将处理解包数据并填写表格。然后数据输入人员只需要检查一切是否正常并将记录添加到数据库中。
这个过程听起来是不是最有效的?您建议使用什么算法来创建该文本块并将其轻松解压到 Access 表单中?
顺便说一句,我非常精通 PHP,但不太精通 Access/VBScript。请详细介绍访问方面的内容。谢谢!
I have a form which is submitted to a PHP page. The data from the form needs to be added to an Access database, however the website is hosted and the Access database is on a network drive. So for now, the form just emails the data to someone who enters it by hand. We're trying to improve this process.
So there is no way for the PHP page to directly access the .mdb file.
My idea is to have the PHP page somehow create a block of encoded data, probably with a checksum hidden in it, and email it to our data entry person. This email would look something like this:
===== BEGIN FORM DATA =====
oipcxunrhunt5klejswtnlerj,m,nxupogxjidoh
jpos89760aq2y984hu5nw3jnm4tiopanj5kjny;s
ljknm;l5nkl;ksnm;linjtg89jx9070g89xc6dgh
890unysl;ne.lmsjo8r7g9n0cf9ogumhlkod9ysd
8hj7pc9pg8uopcfmity68od7r9pyh9pm9pfghpju
ypxdekopslp4mpsmkl;4m;slkmk;smjilenmuops
inuobnuiou5io5nuosiun5oin5u4oinu5oiwnu3o
in2oinounion0uonio76n598n109yb9705btbsnb
===== END FORM DATA =====
UUencoding comes to mind, though really I guess I just need some sort of encryption algorithm that would be easy to implement in both PHP and Access (VBScript).
The last part, of course, is on the Access input form there would be a button. This button would pop up a text box, the data entry person would just paste the above block of text into the box and click ok, and some macro code would handle unpacking the data and fill in the forms. Then the data entry person would just need to check that everything's fine and add the record to the database.
Does this process sound like the most efficient one? What algorithm would you recommend to create that block of text and easily unpack it into an Access form?
By the way, I'm very proficient at PHP and not so much at Access/VBScript. Please be verbose about the Access side of things. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
按照@theMike 的建议思考,我建议完全绕过电子邮件。
请记住,Access 可以直接与 MS XMLHTTP 库交互,因此它可以直接与网页对话。因此,您需要设置 Access 可以加载的 PHP 脚本,以返回 Access 需要处理的内容。我的一位客户使用此功能将库存从他们的 Access 数据库上传到他们的网站。它也可以在相反的方向上工作(即下载)。
您是否要将表单输入的结果存储在数据库中或仅存储在文本文件中取决于您是否有可用的数据库。如果您使用数据库,那就非常简单了。如果您使用文本文件,我建议每个表单结果一个,而不是将每个表单结果作为一行附加到单个文本文件中,因为处理单个文件比处理文本文件的多行要容易得多。但是,如果您的 PHP 页面下方已经有一个数据库抽象层,那么您很可能能够使用它通过 SQL 处理文本文件(如果您的抽象层支持)。
Thinking along the lines of what @theMike suggested, I would suggest entirely bypassing email.
Keep in mind that Access can directly interface with the MS XMLHTTP library so it can talk directly to a web page. Thus, you'd set up PHP scripts that Access can load that return the content that Access needs to process. One of my clients uploads inventory to their website from their Access database using this functionality. It can work in the opposite direction, too (i.e., downloading).
Whether or not you want to store the results from the form input in a database or just in text files depends on whether you have a database available to you. If you use a database, it's pretty easy. If you use text files, I'd suggest one per form result, rather than appending each form result as a row in a single text file, since it's a lot easier to process individual files than to work with the text file's multiple rows. However, if you already have a database abstraction layer sitting beneath your PHP pages, you might very well be able to use that to work with the text files via SQL (if your abstraction layer supports that).
也许你可以用不同的方式解决这个问题?让 PHP 将其数据转储到 MySQL 数据库,然后让 Access 端在加载数据库时从数据库中提取新数据。
Maybe you can conquer the problem in a different way? Have the PHP dump its data to a MySQL database and then have the Access side pull new data from the database when it is loaded.