Gossamer Forum
Home : Products : DBMan : Customization :

"Email This" Option

(Page 2 of 2)
> >
Quote Reply
Re: "Email This" Option In reply to
My typo. I see it now.

It should be

Code:
unless ($rec{$db_key}) {

(I'll fix in my previous post it in case anyone is reading this later on.)


------------------
JPD





Quote Reply
Re: "Email This" Option In reply to
OK JPD ... obviously I get the error

"There were problems with sending your email message: No record was returned from the search"


So something must be really wrong. You think it has something to do with the fact that I do not use the autogenerate forms feature ? Or is this a stupid question ?

This is the database definition I have in default.cfg :

%db_def = (
ID => [0, 'numer', 5, 5, 1, '', ''],
Title => [1, 'alpha', 0, 255, 1, '', ''],
FirstName => [2, 'alpha', 25, 25, 1, '', ''],
LastName => [3, 'alpha', 25, 25, 1, '', ''],
Number => [4, 'alpha', 5, 5, 1, '', ''],
Street => [5, 'alpha', 30, 30, 1, '', ''],
Bloc => [6, 'alpha', 4, 4, 0, '', ''],
Floor => [7, 'alpha', 2, 2, 0, '', ''],
Entry => [8, 'alpha', 3, 3, 0, '', ''],
Apartment => [9, 'alpha', 5, 5, 1, '', ''],
Sector => [10, 'alpha', 2, 2, 0, '', ''],
PostalCode => [11, 'alpha', 8, 8, 1, '', ''],
City => [12, 'alpha', 25, 30, 1, '', ''],
StateProvince => [13, 'alpha', 25, 30, 0, '', ''],
Country => [14, 'alpha', 20, 25, 1, '', ''],
Email => [15, 'alpha', 40, 50, 0, '', ''],
WebPage => [16, 'alpha', 40, 60, 0, 'http://', '^http://'],
Phone => [17, 'alpha', 20, 20, 0, '', ''],
CellPhone => [18, 'alpha', 20, 20, 0, '', ''],
Fax => [19, 'alpha', 20, 20, 0, '', ''],
Profession => [20, 'alpha', 40, 40, 1, '', ''],
Age => [21, 'numer', 2, 2, 1, '', ''],
Height => [22, 'alpha', 10, 10, 1, '', ''],
Weight => [23, 'alpha', 10, 10, 1, '', ''],
Eyes => [24, 'alpha', 20, 20, 1, '', ''],
Hair => [25, 'alpha', 20, 20, 1, '', ''],
MaritalStatus => [26, 'alpha', 0, 255, 1, '', ''],
Children => [27, 'alpha', 0, 255, 1, '', ''],
HowMany => [28, 'alpha', 2, 2, 1, '', ''],
Comments => [29, 'alpha', '40x3', 800, 1, '', '']
);
Quote Reply
Re: "Email This" Option In reply to
No, not using autogenerate won't be a problem.

But that does tell me something, anyway.

Look in the source code of your send record form. There should be a hidden field that looks something like:

<input type="hidden" name="ID" value="something">

The something above would be the $db_key value of the record you're sending. Is it there?

If not, you'll need to look to the link that you use to get to the send record form. You need to be sure that it is within sub html_record (or sub html_record_long, if you're using the short/long display mod) and that it includes

&$db_key=$rec{$db_key}

Lemme know what happens. Smile

------------------
JPD





Quote Reply
Re: "Email This" Option In reply to
Hi JPD !
Hmmm.... strange thing !
1) Indeed, I DO NOT have a field that says

<input type="hidden" name="ID" value="$db_key">

I only have the following :

<form action="$db_script_url" method="POST" name="form1">
<input type=hidden name="db" value="$db_setup">
<input type=hidden name="uid" value="$db_uid">
<input type=hidden name="$db_key" value="$rec{$db_key}">

I HAVE ADDED THAT INPUT, TRIED IT BUT IT IS STILL TELLING ME : "There were problems with sending your email message: No record was returned from the search "

2)The send_record_form is within the sub html_record (at the end) and says :

print qq|
<a href="$db_script_link_url&send_record_form=1&$db_key=$rec{$db_key}">Email this recipe to a friend</a>
|;

Seems to be the right syntax, right ?

Thanks,

Luke

[This message has been edited by lukebrenner (edited March 26, 2000).]
Quote Reply
Re: "Email This" Option In reply to
Luke:

As you can see it's adding html coding to your link <B> </B>.

This will cause the link not to work. I could be wrong but I think that having bold turned on for search results will cause problems in some cases.

In your cfg file:

# Bold search results (1 = Yes, 0 = No).
$db_bold = 0;

Change this setting to 0. You can also specifically use bold for certain sections of your html records.

Hope this solves your problem Smile
Quote Reply
Re: "Email This" Option In reply to
What I said and what you said are the same thing. Smile I was translating the $db_key variable as it should be on the actual html form. (You did say that your $db_key field is 'ID', right?)

Understand that debugging is a long, slow, arduous task. We need to take one thing at a time.

We now know that, for some reason, the record isn't being found.

I need you to alter the "No record was returned from the search" message to see if the key value is being sent. Change

Code:
$message = "No record was returned from the search";

to

Code:
$message = "No record was returned from the search for --$in{$db_key}--";

See if there is a value between the dashes.


------------------
JPD





Quote Reply
Re: "Email This" Option In reply to
JPD, thanks infinitely for your patience. You know, if we can't solve it, the heck with it ! I really do not want to take up so much of your precious time ...

Brrrrr ... I did exactly what you said and I got the following error :

There were problems with sending your email message: No record was returned from the search for ----

So there is no value between the dashes. I re-checked my default.cfg and the $db_key is indeed set for 'ID'

You know, after I do the search and the respective record comes up, just below of the record table I have that link : E-mail this recipe to a friend". Here's the link when I put the cursor over it :

http://www................../dbman/db.cgi?db=default&uid=admin.95418050885459&send_record_form=1&ID=<B>0023</B>

** In this case I searched for the record with the ID 0023.


Luke
Quote Reply
Re: "Email This" Option In reply to
THE HECK !
That was it ! It wooooorks !

I still have a last question though :
Let's say in the "recipient's email address:" I type an invalid e-mail address. Will the sendmail program send me an error message at the address specified in "your e-mail address" or should it be defined as a "return address" in the db.cgi file ?

Thanks guys, thanks a lot to all of you who helped me so much. May your effort be rewarded !

Thanks again,

Luke

[This message has been edited by lukebrenner (edited March 27, 2000).]
Quote Reply
Re: "Email This" Option In reply to
Thanks, Lois for seeing that. I should have asked long before to see the URL generated by the link. Smile

I don't know if you'll get a return message back or not if you enter a wrong email address. The message may just go out into the ozone. Give it a try.


------------------
JPD





Quote Reply
Re: "Email This" Option In reply to
Hi JPD,
you won't believe it but during the time we tried to find out the cause of the blank variables, I SAW that <B>...</B> and even asked nyself for a second why does it appear there. But ... didn't think to turn the bold feature off.

Yes, I tried to enter an invalid (incomplete) e-mail address and indeed, it went into the O-Zone ...
I think though that it has to be a parameter used with sendmail. I'm gonna check out the manual for sendmail.

Luke

****************************************
Update : so I tried it and it didn't come back AT THE ADDRESS SPECIFIED IN SENDER.

I did GOT AN NON-DELIVERY message though, but in my Unix shell, when I use pine.
Seems normal to me ...

Luke

[This message has been edited by lukebrenner (edited March 28, 2000).]
Quote Reply
Re: "Email This" Option In reply to
i get internal server error as soon as i make changes to db.cgi
i have modified the html.pl and the default.cfg when i edit the cgi file i get that error..
any suggestions?

thanks

Quote Reply
Re: "Email This" Option In reply to
Oh, there could be a number of possibilities. One could be that you put the elsif lines in the wrong place. (That seems to be a common error.)

I would have to see your file to know for sure. Copy your db.cgi file to a web-accessible directory (one where you would place .html files) and rename it to db_cgi.txt. Then come back here and tell me where I can pick it up.


JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: "Email This" Option In reply to
i finally got it working i got a new text editor and did it using that one. when i did it with notepad it addedd extra characters to end of lines i think that was the problem coz the notepad edited is about 500 bytes longer.
anyways my other question is ..is it possible to send the email in HTML format?
thanks for your help


Quote Reply
Re: "Email This" Option In reply to
It probably is possible to send the email in html format. I think you just need to add html codes.

However, understand that not everyone uses mail readers that can read html format. I have gone back to using Pine to read my email. I find it extremely annoying to get email which is in html format and usually I delete it without reading it.


JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: "Email This" Option In reply to
I have to agree with JPDeni about receiving HTML coding in email. I do the same and delete the messages without reading them, and encourage people to NOT send me messages with HTML coding.

But that's besides the point Smile

There is a mod written to send HTML email. It's called "Forward_record_with images" and can be found in the DBMan rescource center.

Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/
Quote Reply
Re: "Email This" Option In reply to
I don't find it in the Resource Center.


JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: "Email This" Option In reply to
Opps I must have had it in my notes, sorry about that.

The url is:

http://www.fastcom.uk.com/dbman/forward_record_withimages.txt

The forum reference is: 84137
Topic: emailthis mod....wanna push it further..

Hope this helps

Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/
> >