Adding Captcha without accessing ASP - forms

A client would like us to add a Captcha to their form at http://www.vilaswi.com/contact/. However, they use a 3rd party to run their authentication through http://www.innline.com/mailforms/vilasform/Record.asp so the form data displayed to the user is really the only thing I have control over. It looks like I can't add the Google reCaptcha PHP to the form as the action is already specified (see below).
<form action="http://www.innline.com/mailforms/vilasform/Record.asp" method="post" name="frmInfo" id="frmInfo" onsubmit="return validateForm()" class="contactform">
Google recommends download verify.php and adding that to the action. Is there another method I could use?
I have tried the honey pot method and that has not curbed the amount of spam submitted.
Thanks in advance for any help!

Related

amp project form submit

I'm currently testing a landing page made with amp.
There's a lot of information on how to make forms but,
nothing on how the form is process.
Where we insert the recipient email?
Do we need to make a submiter.php?
Thank you!
Yes, you need to create a server endpoint to handle the form submission. If you use method="POST" then you should also add action-xhr="submitter.php" and then submitter.php should collect the values in the form, and return JSON to the AMP page.
If you use method="GET" then you can use action="submitter.php" or action-xhr="submitter.php. If you use action and not action-xhr then submitter.php doesn't need to return JSON, it can just be a normal PHP/AMP page that takes the values of the form and sends an email or whatever you want

Send email when submit button is pressed

I have a really simple form that allows a user to input an email address here:
<form method="post" action="http://www.mydomain.com/page2/">
<input type="email" name="email">
<input type="submit" value="Submit">
</form>
This works correctly and it takes the visitor to www.mydomain.com/page2 when the submit button is clicked.
I am trying to get it to email me this input email address also when the submit button is clicked. I understand how to email using PHP but can the action have two urls?
Or is there a simpler way of doing this?
On /page2/ access the email in the global variable $_POST['email']. And then you can send it to yourself with PHP mail(). Example:
mail('myemail#domain.com', 'Someone submitted my form', 'Their email was: ' . $_POST['email']);
If you are stuck somewhere else, let me know and I can update the answer.
Once a form is submitted, you are no longer on that page. You've navigated away.
The other way you can do this is submit the first action via AJAX, then submit the form naturally to the second destination. I would suggest using jQuery to make your AJAX calls since most of the AJAX code is already there for you to use.
Another option is to have page2 be a php script, and have it perform the two actions once it receives the form data. See: Post to another page within a PHP script
I understand how to email using PHP
Then I would recommend writing some PHP code that sends the email to you.
but can the action have two urls?
No. A web browser can't make two requests at the same time. Which response would take precedence?
Nor does it need to. Now, you have a target already:
http://www.mydomain.com/page2/
Don't you control that page? That would be the page on which you'd put your PHP code for sending an email. If you don't control that page, then you would want an intermediary page. Something like:
sendmailandredirect.php
(Named solely to illustrate intent, you can call it what you like.) What this page would do is send the email, then issue a redirect to your final target. Something like:
header('Location: http://www.mydomain.com/page2/');
In effect, there would be "two urls" but they're invoked in serial instead of in parallel.
If you wanted to keep the code seperate and the action url as /page2/ you could fire off an ajax request on submit to your sendmail handler.

Accessing asp page from Java

I am trying to access website http://www.billing.mppkvvcl.org/wzltbill.asp. On this page I need to choose "Service Number" and provide service number in text box.
In the background it executes
form id="ActionForm" name="LTViewFrm" class="atnbill" method="post" action="wzltatnpay.asp" onsubmit="return yav.performCheck('LTViewFrm',LTViewArray,'classic');"
I am trying to use HttpURLConnection to do this but I am having some problem in accessing asp class and asp method.
Please let me know if someone has any idea to do this.
Thanks.
You should look into httpclient library, as it provides feature on form submission. Check out this example code on how to submit form using the library.

Joomla module submit form can't access database

I've been searching the net for an answer to my question but I just can't seem to find one, even though it's probably pretty simple.
I have a joomla module that signs up users to a newsletter, when clicking the submit button I navigate to submitsignup.php file. I do this using the form action value like so:
form action="modules/mod_cmsnewslettersignup/otherfiles/submitsignup.php" method="post" id="subForm"
Within this submitsignup.php file I can not access any joomla classes, such as:
$db = JFactory::getDBO();
I know that I can't access any joomla classes because I made direct access to the submitsignup.php file, but I was wondering how do I access this file so that I can have access to all the Joomla classes?
Thanks.
If you are reloading the page when you submit the form, then there is a simple solution that solves both the problem of using a direct URL and of having to load the Joomla framework in that file. Basically change your module code to something like this -
if ($_POST["formsubmitted"]){
the code you run when the form is submitted
echo success or failure message
} else {
the code you run to display the form
<form action="<?php echo JURI::current(); ?>" method="post">
<input type="hidden" value="true" name="formsubmitted">
}
Basically, you submit the form to the page that displays it. Then in your module you add a hook to either process the submitted form or display the form depending on what you find in $_POST. You can add some simple security to make sure that the form is being submitted from your site.

using form buttons for spamproof email-addresses

I have been looking at some methods for spamproof email methods here. I'd like to propose a more simple approach: Since I need a couple of different email addresses I considered just using a selectbox with JS or serverside redirect, as per examples on here.
Because google doesn't spider forms (dixit Matt Cutts), and spam-harvester script don't either (I think????) this would make sense to do.
I would love to be able to do this without using a script. So why not use one form per email?
<form action="mailto:test#domain.tld" method="get">
<input type="submit" value="test#domain.tld"/>
</form>
It seems the button text can be copied but not pasted, so that's a disadvantage.
Is this approach any good? or any other recommendations?
A robot uses the text of the page to get the email. It does not care if that text is in a button or within the body so using a button will not help.
Outside of using javascript, the only solution I know of would be written text, an image or Flash.
Create an image with your email or write out the email like: "test at domain dot tld"
Flash could provide you with a more secure (but not 100%) way of allowing people to click on an email but would not work on iPhone browsers and those that do not have the plug-in.
Another way is to use a simple captcha to before displaying the email in the PHP code.
Email: (1+2 = ?) then test#domain.tld
Because:
The email address is still in the page, and thus easily harvestable
mailto: URIs as form actions often fail
The reason server side form handlers stop email addresses being harvested is because the email address is not exposed to the user.