PDA

View Full Version : Form mail redirecting on a subdomain?


Harry Doldersum
7-9-06, 09:46 AM
Hi all,

Wonder if you can advise me in following? I've noticed that form mail redirecting doesn't work properly anymore on a subdomain? (It works ok on the main domain, but the subdomain is being thrown to our 404 error page).

The format used on the page is as follows:

Confirmation page: <input type=hidden name="redirect" value="http://subdomain.url/thanks.htm">

Error input page: <input type=hidden name="missing_fields_redirect" value="http://subdomain.url/formerror.htm">

I've tried to use direct page addressing as well (http://domain.url/subdomain_folder/thanks.htm, but that doesn't alter anything?

I'd appreciate any advise on how to solve this... :sweatdrop

Cheers,
Harry D.

stevel
7-9-06, 10:31 AM
Does the subdomain URL work if you just type it in a browser? My guess is not and that the form mail is not relevant to the issue.

Harry Doldersum
7-10-06, 04:05 PM
Hi Stevel,

The subdomain url works just fine - that's the weird thing. Also, typing the redirect urls directly into the browser also works ok, the pages are retrieved without any problem.

It's just the redirect command in the form that is unable to locate the page?

Edit:
Stevel, is it possible that the script can't be found, when invoked from the subdomain? Just guessing here, btw... ;)

It's currently invoked through the same path as on the main domain - which used to work before the migration. Perhaps this is changed now? The command used now (copied from main domain) is: <form method="post" action="/cgi-bin/script_filename">

stevel
7-10-06, 05:04 PM
Does the form submission actually send the mail? If so, then the script is found.

Redirects are fairly straightforward. You could experiment with using a redirect URL that is not a subdomain to see if that makes a difference.

Harry Doldersum
7-16-06, 10:04 AM
Well, if not in a subdomain it works perfectly. On the main domain, I have the same page with similar commands. It worked like a charm, before the relocation - I can't understand why it doesn't work anymore??

now also tried same folder:
<input type=hidden name="redirect" value="thanks.html">
tried subdomain urls:
<input type=hidden name="redirect" value="http://subdom_name.domain.com/thanks.htm">
tried main domain / subdomain folder url:
<input type=hidden name="missing_fields_redirect" value="http://domain.com/subdom_folder/formerror.htm">

When typing these full urls (the last 2) into the browser's address line, they come up just splendid. But the script cannot find them? A message in the form goes get sent out correctly - it's just these 2 response pages that aren't working.

It works excellent on the main domain? What can be wrong here...?

Is here someone who runs such redirect forms on a subdomain, who could forward me an example? There must be something changed since the relocation, but I don't have the possibility to find what's causing this?

Harry Doldersum
7-19-06, 01:15 PM
Is here someone who runs such redirect forms on a subdomain, who could forward me an example? There must be something changed since the relocation, but I don't have the possibility to find what's causing this?

Anyone? :o

Harry Doldersum
7-20-06, 02:00 PM
I've solved this issue for the subdomain, by removing the email form from the subdomain and relocating it to the main domain. It works perfectly now.

I can only conclude, that is apparently no longer possible to use email forms from a subdomain? Whatever the reason might be - it's well possible, that it is my own fault, but I can't tell. :confused:

Is there ANYONE who has email forms working on a subdomain? If so, I'd like to get in touch with you... ;)

Best regards,
Harry D.

joshuamc
7-20-06, 02:34 PM
I can only conclude, that is apparently no longer possible to use email forms from a subdomain?
Would you mind posting the entire script between the form tags with actual domains included? I would like to see what is going on. If you don't want it public, PM it to me.

Harry Doldersum
7-22-06, 07:44 AM
Thanks mate - I've sent the info as a PM, since I could include the nitty gritty details then... ;)

Harry Doldersum
7-23-06, 07:23 AM
As per Joshua's request, I'm also posting this in the forum now. ;)

----------- quoted message ------------

Hi Joshuamc,

I appreciate that you're willing to have a look at this - here's the code that is giving the problem:

--------------- begin ------------------
<form method="post" action="/cgi-bin/SaveForm.pl">
<TABLE><center>
<input type=hidden name="recipient" value="joop@doldersum.com">
<input type=hidden name="required" value="realname, email">
<input type=hidden name="redirect" value="http://geneology.doldersum.com/thanks.htm">
<input type=hidden name="missing_fields_redirect" value="http://geneology.doldersum.com/formerror.htm">

<tr><td><font color=#ff0000>Full name * </font>:</td><td><input type=text name="realname" size=60></td></tr>
<tr><td><font color=#ff0000>Email address *</font> :</td><td><input type=text name="email" size=60></td></tr>
<tr><td>Subject:</td><td><input type=text name="subject" size=60></td></tr>
<tr><td>Street:</td><td><input type=text name="street" size=60></td></tr>
<tr><td>Zip code:</td><td><input type=text name="zip" size=60></td></tr>
<tr><td>City:</td><td><input type=text name="city" size=60></td></tr>
<tr><td>State/Province:</td><td><input type=text name="state" size=60></td></tr>
<tr><td>Country:</td><td><input type=text name="country" size=60></td></tr>
<tr><td valign=top>Message:</td><td><textarea name="message" rows=10 cols=50
wrap></textarea></td></tr>
</TABLE>
<br>
<input TYPE="submit" VALUE="Send form">&nbsp;&nbsp;&nbsp;<input TYPE="Reset" VALUE="Reset form"><br>
<br>
</center>
</form>
--------------- end ------------------
When this code is executed on the main domain, referring to response pages in that location is no problem. When relocating this code to the subdomain and altering the response page path to the response pages of (and in) the subdomain, it doesn't find the response pages - it appears, that the message is sent off correctly, it only doesn't find the response pages.

By now, I've also removed this subdomain from .htaccess and have recreated it using the appropriate screen in OPS, as suggested elsewhere on the forum (was related to another matter, but who knows...).

I've also placed the code above back in the subdomain, so you can have a look at what it's doing.

Before the relocation, this code worked just fine...?

Hope you can help me sort this out, mate. I've got the alternative up now, so the initial pressure's off - but I still would like to get this working as intended.

----------- end quoted message ------------

Joshua, I had a look at the script - and the subdomain wasn't listed in the referrer list. The mail did get sent out however. Adding the subdomain to the list did not change things, unfortunately.

I noticed in the FAQ, that Powweb has a different standard formmail script these days - I'll try to insert that and see if that might improve things.

Cheers,
Harry D.

Harry Doldersum
7-23-06, 07:36 AM
I noticed in the FAQ, that Powweb has a different standard formmail script these days - I'll try to insert that and see if that might improve things.
When inserting the new standard formmail script path (http://www.powweb.com/scripts/formemail.bml) and intentionally omitting a required field in the message form, I now get a standard formerror response page from powweb - instead of my own.

What ever the issue is, it seems to be persistant... ;)

Enjoy the Sunday - hope you can find a dumb error of mine, so we can solve this easily. :D

Cheers,
Harry D.

Harry Doldersum
8-9-06, 04:54 PM
/bump (sorry, peeps...). :o

Anyone at all, please?? When I wrote that form mail was apparently disfunctional at subdomains, I got a response that this was unlightly - however, no one has been able to point out where the above form goes wrong...??? :confused:

Tests with the current standard formmail script also ignores the response page settings, as noted above.

Who can (read: is willing) to help me out with this? If *you* are someone who has formmail running on a subdomain, please contact me?

Until the relocation, it all worked just fine - since then, formmail on a subdomain is not working anymore (see above for details). I worked around it, by deleting the formmail from the subdomain, but that isn't how it should work: the admin of the subdomain is now no longer in control of his forms... :confused:

Harry Doldersum
8-14-06, 08:21 AM
I've forwarded this issue to powweb support now - hope someone can look into the domain setup and see what's wrong there.

It appears, that the form code works correctly when executed from someone else's domain, here on powweb. This rules out the possibility that the error would be in the form coding...

And since it all worked perfectly before the transisition to the new platform - the cause of the malfunction can only reside in the new domain setup. I hope support can get this sorted soon.

Harry Doldersum
8-14-06, 10:55 AM
From trail & error research and with help of a fellow forum user (thanks, mate! ;) ), we've found out that the problem is caused by the privacy settings of the Norton internet suite. One would need to add an extra filter rule to allow the form mail script to execute properly.

Unfortunately, the added filter line cannot include your own domain name - it HAS to refer to powweb.com: only then, the script gets to a stage where it processes properly. (My visitors would have no way of knowing this, of course - I'll have to figure out a way to inform them, since they won't get to see my custom error response page, but powwweb's: and that page doesn't mention this pesky little detail).

Figured, I'd post this - since I cannot imagine being the only one to have this problem.

stevel
8-14-06, 11:26 AM
Are you checking the referrer field as some sort of protection against spoofing? That's extremely unreliable. As you found, NIS as well as many other kinds of security/privacy software, masks or removes the referrer when the domain changes and spammers can (and do) easily forge the referrer.

cc1030
8-14-06, 12:09 PM
Are you checking the referrer field as some sort of protection against spoofing? That's extremely unreliable. As you found, NIS as well as many other kinds of security/privacy software, masks or removes the referrer when the domain changes and spammers can (and do) easily forge the referrer.

He's using the PowWeb-supplied script ("http://www.powweb.com/scripts/formemail.bml"), so that means that PowWeb is checking the referer field, and rejecting if the field is blank. Definitely not cool, though I imagine that they did this as an obstacle for spammers (to make sure the script wasn't called directly), and (as usual) the innocent get caught in the crossfire.

stevel
8-14-06, 01:23 PM
It's not an obstacle for spammers - the spammers always supply the URL of the script in the referrer field. It is not any sort of security at all. The script PW is using is known to be abused by spammers - the only "defense" is that the file name is not one of the typical ones.

If you are collecting feedback from users, use one of the scripts that send mail only to specific addresses and where the destination is not taken from the script. TFMAIL is an easy one to use, and NMS FormMail has that as an option.

Harry Doldersum
8-14-06, 04:44 PM
TFMAIL is an easy one to use, and NMS FormMail has that as an option
OK, so the best option is to drop the powweb supplied script and replace it with a more reliable one. That would need to be no problem, guys - thanks for the 2 pointers.

I'll look them up and try them out. ;)