PDA

View Full Version : Encryption - blank results



GillyB
25-Mar-2009, 08:25 PM
Hi,
I'm currently trying your encryption routines and I'm receiving blank e-mails as soon as I specify the encryption filter, although the form seems to be submitting OK.
Here are the parameters I'm using:

formmail_enc.php: I tried both versions of the following:
/*$FILTERS = array("encode"=>"$REAL_DOCUMENT_ROOT/cgi-bin/fmencoder -kNatMor-pub.txt",
"null"=>"null",
'csv'=>'csv'); */
$FILTERS = array("encode"=>"/home/natmor/public_html/cgi-bin/fmencoder -kNatMor-pub.txt",
"null"=>"null",
'csv'=>'csv');

HTML Form:
<form action="http://www.mysite.co.uk/formmail_enc.php" method="post" class="clear">
<input type="hidden" name="mail_options" value="PlainTemplate=csvtemp.txt,TemplateMissing=nv" />

When I submit the form using these parameters (ie: with no encryption filter specified) I received the results below:
Steve;Gilbert;07092343879;01239654267;redpoppy52@gmail.com;Select Airport;Select Alt. Airport;4;Depart Date;Month;Return Date;Month;No. Adults;0;7-11 yrs;2-6 yrs;under 2 yrs;No. of Rooms;nv;Price Range;Please Select...;nv;nv;nv;nv ==================================

I then added the encryption filter to the form as follows:
<input type="hidden" name="filter" value="encode">
and re-ran the form submission, all I got back was as follows:
==================================
(ie:non of the data). I tried using a direct path instead of $REAL_DOCUMENT_ROOT, but the result was the same. I've checked that the name of the text file for the Public Key is correct.

Can you advise please.

russellr
25-Mar-2009, 09:22 PM
Hi,

Do you have DEF_ALERT set so that FormMail can advise you of errors?

Also, can you please send me the URL for your form? I'll take a look at it.

GillyB
25-Mar-2009, 10:13 PM
Hi Russell,

Thanks for quick reply. I do have DEF_ALERT set, but nothing was reported. The URL of the test form is http://www.naturallymorocco.co.uk/request_quote_enc2.php

Thanks for your help.

russellr
25-Mar-2009, 10:35 PM
Hi,

Your fmencoder is installed OK, and the form looks fine at a glance.

Please uncomment these fields:


<input type="hidden" name="filter_options" value="Attach=csvtemp.fmencoded" />
<input type="hidden" name="filter" value="encode">
Also, note that the extension of the attached file should be ".fmencoded".

Do you get an attachment when you submit this form after these changes?

Can you also confirm that you're wanting to generate a CSV file (using PlainTemplate)
and you want that file encrypted and attached to the email?

That's what the above will/should do.

GillyB
26-Mar-2009, 11:51 AM
Hi Russell,

I've uncommented those 2 lines and I do receive an attachment (I changed the file name suffix as you suggested), but there's nothing in the file. When I double-click to open it, the decoder program opens but the display is blank. The file size is only 131b.

I'm just using this form as a test to see if the encryption routines will meet our needs. We want to start collecting credit card and passport details on-line from clients who book with us, together with other less sensitive data which we already collect, so there will be a mixture of encrypted and non-encrypted data. The ideal would be to have 1 file attached containing all this data in CSV fortmat - we have routines that automatically pick up this file and import it into the client's record on our Access database. If that's not possible, I may need to design 2 forms, 1 for sensitive and for non-sensitive data, then concatenate them - but I'm open to suggestions here!

Thanks again for your help.

russellr
27-Mar-2009, 07:03 AM
Hi,

OK, it sounds more and more like there's a problem with PHP on the server.

My guess at this stage is that the system temporary directory/folder is not setup correctly, and PHP is not generating an appropriate error return.

All I can suggest is that you provide me access details to your server and I take a look around to diagnose the problem.

You can use this secure form:
https://secure.rootsoftware.com/~tectite/sendsecret.php (https://secure.rootsoftware.com/%7Etectite/sendsecret.php)

GillyB
30-Mar-2009, 10:37 AM
Hi Russell,

Thanks for getting back to me. At the moment I can't get hold of the company bosses to get permission for you to sign on to the server, but I've been in contact with our hosting providers, who give us a very good support service.

Here's what they've reported back to me from things they've tried over the weekend:
1) Change $SET_REAL_DOCUMENT_ROOT = ""; to
$SET_REAL_DOCUMENT_ROOT = "/home/natmor/public_html";
2) Change the file permission for /cgi-bin/fmencoder to 755 from 711 - not sure if it should be set to 711 or not.
3) The tmp path for php is setup correctly but there may be a function restriction. However, I cannot see this is the error log.

None of this has made any difference - I'm still getting a blank attachment returned. Are there any instructions that I can pass on to the support people to get more information/find a solution?

Thanks again for your help.

russellr
01-Apr-2009, 12:05 AM
Hi,

OK, something with PHP isn't working correctly.

It could be the "popen" function, or with executing shell output redirection, or with opening temporary files.

The only way to diagnose it is to add debugging code to the relevant places in FormMail and analyze the results to determine where the fault lays.