Anybody? :-)
Welcome to the Tectite Forums! You can download and get support for our free PHP FormMail (form processor) and other free software.
OK, here's the situation. I have a simple contact form on every page of my blog at utterlyboring.com. I just recently started using tectite's formmail for it (was just using a homebrew php form, but it was getting hammered by bots). The form is still getting hammered by bots, so I'm going to require image verification. However, I didn't want to have to render the image on every single page that loads on my site as it's a fairly busy site. So my idea was to put the image verification on a 2nd page of a multi-page form (and note that everything was working fine as a single form, just not when I try to make it a multiple-page form by adding a few fields). Here's the form code for my first form that's included on all the pages of the site:I'm using a formmail.ini file as well:HTML Code:<?php $url = getenv('REQUEST_URI');?> <form action="http://www.utterlyboring.com/mailjake.php" method="post" target="blank" onSubmit="window.open('about:blank','blank','width=350,height=200,directories=no,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=yes')"> <input type="hidden" name="recipients" value="ub" /> <input type="hidden" name="env_report" value="REMOTE_HOST,REMOTE_ADDR,HTTP_USER_AGENT,AUTH_TYPE,REMOTE_USER"> <input type="hidden" name="this_form" value="http://utterlyboring.com/<?php echo $url;?>" /> <input type="hidden" name="multi_start" value="1" /> <input type="hidden" name="next_form" value="http://utterlyboring.com/formimgverify.php" /> <td class="menu_main">name: <input type="text" name="realname" class="forms"><br> email: <input type="text" name="email" class="forms"><br> subject: <input type="text" name="subject" class="forms"><br> message: <textarea name="Mesg" class="forms" cols="24" rows="3"></textarea><br> <input type="submit" class="button" value="send"> <input type="reset" class="button" name="Reset" value="clear"></td></form>
The code for my 2nd form page is as follows:Code:[email_addresses] ub = "(deleted)" jo = "(deleted)" [special_fields] required = "Mesg"
Upon submitting the form, I get the "An error occurred while processing the form .HTML Code:<form> <form action="http://www.utterlyboring.com/mailjake.php" method="post"> <input type="hidden" name="recipients" value="ub"> <input type="hidden" name="env_report" value="REMOTE_HOST,REMOTE_ADDR,HTTP_USER_AGENT,AUTH_TYPE,REMOTE_USER"> <input type="hidden" name="this_form" value="$this_form_url"> <input type="hidden" name="realname" value="$name"> <input type="hidden" name="email" value="$emailaddr"> <input type="hidden" name="subject" value="$subject"> <input type="hidden" name="Mesg" value="$mesg"> <input type="hidden" name="required" value="imgverify"> <img src="http://www.utterlyboring.com/verifyimg.php" alt="Image verification" name="vimg" /><br> <p>To send your email, please enter the characters you see in the image:</p> <input type="text" size="12" name="imgverify" /> <br><br> <input type="submit" value="send"></form>
Please contact us directly since this form is not working .
We apologize for any inconvenience this error may have caused." error. The alerts sent to me don't provide me anything useful.
Turning on debug mode nets me the following (and I don't ever see the image verification page in either instance):
I know this is probably something simple and silly, but since this my first multi-page form, so be nice ;-)Code:Notice: Use of undefined constant EMAIL_NAME - assumed 'EMAIL_NAME' in /home/utterlyb/public_html/mailjake.php on line 2244 Notice: Use of undefined constant EMAIL_NAME - assumed 'EMAIL_NAME' in /home/utterlyb/public_html/mailjake.php on line 2245 Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/utterlyb/public_html/mailjake.php:2244) in /home/utterlyb/public_html/mailjake.php on line 3499 An error occurred while processing the form . Please contact us directly since this form is not working . We apologize for any inconvenience this error may have caused.
Also What would be the proper way to require the imgverify field be filled? Obviously it can't be in the INI file (unless I'm missing something) as I can't actually fill in that field on the first form, as it'll be invalid, won't it? So I'm requiring it on the 2nd form, but I've heard some bots can bypass that if it's in the code and not in the .ini file.
Any help would be greatly appreciated.
Thanks!
Anybody? :-)
wot ur wanting to do is fine
the error messages ur seeing mean youve broken something. you need to fix it first.
the alert messages *always* say something useful, even if you dont understand them.
i suggest you post the alert message here so we can comment on wots wrong
(fix the broken code first, tho)
I wasn't trying to be a jerk before, sorry if I came across like that, but this was the only thing I was getting in my alert e-mails:Since I was getting the emails fine and my target_email line appeared to be formatted fine based on the docs , I turned off alerts as those warnings were getting annoying.Code:The following potential problems were found in your configuration: Warning: Your TARGET_EMAIL pattern "EMAIL_NAME@utterlyboring\.com$" is missing a ^ at the beginning. Warning: Your TARGET_EMAIL pattern "EMAIL_NAME@orty\.com$" is missing a ^ at the beginning.
Here's my target_email:The in-line docs don't cover how to mix straight e-mail addresses with a domain from emain_name like that, so if I'm doing something wrong, let me know.Code:$TARGET_EMAIL = array(EMAIL_NAME."@utterlyboring\.com$",EMAIL_NAME."@orty\.com$","^utterlyboring@deleted\.com$");
Anyhow, when I reimplemented the code above like I had it before and tried it out on a test page (utterlyboring.com/mailtest.php), I get this error via an alert e-mail (which I didn't receive before):
Ideas?Code:To: my alert email From: FormMail@www.utterlyboring.com The following error occurred in FormMail : not_valid_url ********** Error=Return URL "http://www.utterlyboring.com/mailjake.php" is not valid Mesg: 'gigit a aiia a' Referring page was http://www.utterlyboring.com/mailtest.php User IP address was 66.39.163.6
Thanks!
these mesgs:
are causing the alert messages. youve damaged the setting of EMAIL_NAME, and so the $TARGET_EMAIL settings are screwy, and then formmail is warning you about them....Notice: Use of undefined constant EMAIL_NAME - assumed 'EMAIL_NAME' in /home/utterlyb/public_html/mailjake.php on line 2244
Notice: Use of undefined constant EMAIL_NAME - assumed 'EMAIL_NAME' in /home/utterlyb/public_html/mailjake.php on line 2245
fix the EMAIL_NAME prob and the alerts will stop
that means ur $TARGET_URLS setting is wrong - it doesnt specify "http://www.utterlyboring.com/". this needs to be set in fmbadhandler and formmailError=Return URL "http://www.utterlyboring.com/mailjake.php" is not valid
OK, I got the form working now (had to set multiformdir in formmail.php -- I missed that in the FAQ, sorry). So image show up on the 2nd page now -- cool!
Having the recipient on both forms was getting me duplicates, so I figured that out.
My last question, and then I'll get out of everybody's hair: Is there a way to require the image verification in formmail.ini for this so I don't have to have a hidden required form field? If I put it in there now, on the first page of the form, the next page says it requires imgverify, even though that's what I'm about to fill out.
But thanks again for all your help with this!
i dunno, sounds like a question for russel
Fair enough -- thanks for your help, Crabtree, and I'll be replacing the various formmail scripts out there that I have setup on a variety of sites with this. Thanks again!Originally Posted by crabtree
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks