+ Reply to Thread
Results 1 to 8 of 8

Thread: Multipage Form With Imgverify On Last Page Only

  1. #1
    Join Date
    Nov 2006
    Posts
    5

    Question Multipage Form With Imgverify On Last Page Only

    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:
    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>
    I'm using a formmail.ini file as well:
    Code:
    [email_addresses]
    ub = "(deleted)" 
    jo = "(deleted)" 
    
    [special_fields]
    required = "Mesg"
    The code for my 2nd form page is as follows:
    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>
    Upon submitting the form, I get the "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." 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):

    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.
    I know this is probably something simple and silly, but since this my first multi-page form, so be nice ;-)

    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!

  2. #2
    Join Date
    Nov 2006
    Posts
    5

    Default Re: Multipage Form With Imgverify On Last Page Only

    Anybody? :-)

  3. #3
    Join Date
    Mar 2004
    Posts
    2,224

    Default Re: Multipage Form With Imgverify On Last Page Only

    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)

  4. #4
    Join Date
    Nov 2006
    Posts
    5

    Default Re: Multipage Form With Imgverify On Last Page Only

    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:
    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.
    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.

    Here's my target_email:
    Code:
    $TARGET_EMAIL = array(EMAIL_NAME."@utterlyboring\.com$",EMAIL_NAME."@orty\.com$","^utterlyboring@deleted\.com$");
    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.

    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):
    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
    Ideas?

    Thanks!

  5. #5
    Join Date
    Mar 2004
    Posts
    2,224

    Default Re: Multipage Form With Imgverify On Last Page Only

    these mesgs:

    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
    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....

    fix the EMAIL_NAME prob and the alerts will stop

    Error=Return URL "http://www.utterlyboring.com/mailjake.php" is not valid
    that means ur $TARGET_URLS setting is wrong - it doesnt specify "http://www.utterlyboring.com/". this needs to be set in fmbadhandler and formmail

  6. #6
    Join Date
    Nov 2006
    Posts
    5

    Default Re: Multipage Form With Imgverify On Last Page Only

    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!

  7. #7
    Join Date
    Mar 2004
    Posts
    2,224

    Default Re: Multipage Form With Imgverify On Last Page Only

    i dunno, sounds like a question for russel

  8. #8
    Join Date
    Nov 2006
    Posts
    5

    Default Re: Multipage Form With Imgverify On Last Page Only

    Quote Originally Posted by crabtree
    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!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Combining MultiPage and fmbadhandler.php
    By onno in forum FormMail Subscription Support
    Replies: 11
    Last Post: 09-Jun-2005, 08:05 AM
  2. Passing args to new formmail form/page
    By labbs in forum FormMail Subscription Support
    Replies: 1
    Last Post: 18-Apr-2005, 08:24 PM
  3. Sample Multi-Page Form
    By russellr in forum FormMail
    Replies: 0
    Last Post: 18-Apr-2005, 04:18 AM
  4. Return All Variables To Form Page On Error
    By cornernote in forum FormMail Subscription Support
    Replies: 12
    Last Post: 31-Oct-2004, 10:20 PM
  5. Submitted form output onto HTML page?
    By LKimber in forum FormMail Subscription Support
    Replies: 2
    Last Post: 13-Apr-2004, 11:39 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts