Forum Moderators: open

Message Too Old, No Replies

Problems with Formmail.

         

aek

1:34 pm on Aug 24, 2002 (gmt 0)

10+ Year Member



I was wondering if somebody might be able to help me. I'm using Formmail.cgi to process a simple web form. The script is based on Matt's script and is supplied by my host. But when I send the form to my E-mail it adds the hidden value redirect and the send value. i.e.

Name: John

Address: 24 ABC road

Request: Help me out

Redirect: www.mydomain.com/formsent.htm

Submit: Submit

Is there any way of not recieving the last two fields?

bobriggs

2:10 pm on Aug 24, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I suspect that redirect shows up because it is capitalized. Try changing the name to the lower case version.

As for Submit=Submit, You probably have something like:
<input type="submit" value="submit" name="submit">
Take out name="submit" and it won't show up.

aek

6:18 pm on Aug 26, 2002 (gmt 0)

10+ Year Member



Thanks for the advice, but it didn't make any difference. Has anybody else got any ideas?

jatar_k

6:26 pm on Aug 26, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I would say you would have to alter the script.

It depends how the script put the fields in the email. For my form mailers(php) I use something like this

foreach ($HTTP_POST_VARS as $key => $value)
{
if ($value == "Submit Form") continue;
if ($value == "Reset Form") continue;
......

The foreach loop puts all the form values together and formats them for the email (not shown). The 2 lines in the beginning of the loop check to see if the value in question is either from the submit button or reset button. If it is, it "continues" which mean it doesn't process anything else in the loop and goes on to the next value.

bobriggs

6:35 pm on Aug 26, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Are you sure you did it right?

1. If you don't supply a name=, there is no name,value pair for the submit. Therefore:
<input type="submit" value="Submit"> - has no name. It never gets sent to the script.

2. As for the redirect. I re-read your post again, and since it's not Matt's script, I can't say for sure. But I've seen others. 'redirect' in lower case is a Config variable, and these are checked against input, and not sent in the body of the mail. In your form:
<input type="hidden" name="redirect" value="yoururlinhere">

Are you actually being redirected to the new page with a capital Redirect?

If you had name="Redirect", which is what it looks like, because that's what the email spat back, it doesn't match the config variable named 'redirect', so it thinks its just another field in your form.

If that doesn't work, you'll have to look at the actual script itself.

aek

11:23 pm on Aug 27, 2002 (gmt 0)

10+ Year Member



Thanks for both your advice. Sorted now!