I'd like to use a contact form for a website I'm creating, but PHP is not an option since the client doesn't wish to use it. Is there a clever way to work around this somehow, by sending email parameters (which is non-standard) perhaps, or by using an external contact form? Are there any good ones that don't use advertising and are easily modified to a different language for example?
Thank you.
Check out formspree.
https://github.com/asm-products/formspree
For action you simply put:
<form action="http://formspree.io/you#email.com" method="post">
<input type="text" name="name">
<input type="email" name="_replyto">
<input type="submit" value="Send">
After verifying your email after the first send this will email you the contents of the form. One thing to keep in mind is that this will take the input names. If you do not include input names it won't send you that form field.
There are hundreds of embeddable (most likely iframe-based) solutions for contact forms, which would enable you to get around using a server-side language like PHP. Just a quick google search will give you some.
Alternatively, you could make a form in HTML, and have a submit button which is actually a mailto: link, and you modify the parameters of that mailto as your form inputs change.
The only downside of this is that it's not as convenient for the user, as it then opens up their email client and they have to actually send it.
Personally, I would try and persuade the client, but if that isn't possible, then those are your options.
Check out www.enformed.io.
Has a couple of interesting options that formspree does not have( Like redirect out of the box, and a html email editor).
I used Formspree but formspree doesn't allow ajax unless you have Gold Version. It doesn't work on the basic so I am planning on making an account on enformed.io. I still haven't used it but I have heard that t is very good. You can also use alerts fro success and error messages.
<form style="margin-left: 6%;" class="email" action="https://www.enformed.io/YOUR_TOKEN" method="post">
<p>Name:</p>
<input type="text" name="first_name" />
<div id="margin" style="height: 0.5%;"></div>
<p>E-mail:</p>
<div id="margin" style="height: 0.5%;"></div>
<input type="text" name="email" />
<div id="margin" style="height: 0.5%;"></div>
<p>Subject:</p>
<div id="margin" style="height: 0.5%;"></div>
<input type="text" name="subject" />
<div id="margin" style="height: 0.5%;"></div>
<p>Message:</p>
<div id="margin" style="height: 0.5%;"></div>
<textarea name="message"></textarea>
<div id="margin" style="height: 0.5%;"></div>
<button type="submit" class="btn btn-default">Submit Form</button>
</form>
Would something as simple as a mailto form work?
Related
This question already has answers here:
Send email with PHP from html form on submit with the same script
(8 answers)
Closed 5 years ago.
The question is how do i make the submit button work so if they press submit, the ff will be send to my email (ex: example#gmail.com).'
If PHP is needed please post the code so i just gonna paste it on my code :D ty
<div id="forms">
<form class="form">
<p class="name">
<input type="text" name="name" id="name" placeholder="Enter Your Name" />
</p>
<p class="email">
<input type="text" name="email" id="email" placeholder="mail#example.com" />
</p>
<p class="text">
<textarea name="text" placeholder="Describe your logo" /></textarea>
</p>
<p class="submit">
<input type="submit" value="Send" />
</p>
</form>
</div>
I cannot find the answer in the existing question of this, So i decided to make another one... the existing is like 2 years ago?
I think you just need to put a mailto action on the <form> tag, i.e.:
<form class="form" action="mailto:someone#example.com">
All you need to do is change your form tag to look like this:
<form action="mailto:address#example.com">
This will send unformatted data to your email address without needing PHP. If you would rather format it in a specific way, then you can use the PHP mail function.
I also removed class="form". Typically this is not needed, but it depends on your reason. If you are using class for CSS you can just reference the element form rather than the class name .form.
I found a similar question here that someone wanted to create a user account loggin similar to this, but it lead me to believe it has to be all done in php in order to handle it and put into a MySQL database. From my understanding this isn't php and it is on the main html website.
How is the data captured and then stored on a database with this code then?
This is taken directly form http://cardoneuniversity.com/
<span class="dominate-and-login-form-text">Already a member?</span>
<form action="https://login.lightspeedvt.com/actions.cfm?lg=447&v=35" method="POST">
<input type="hidden" name="action" value="login">
<div class="form-group username-field">
<label class="sr-only" for="exampleInputUser3">Username</label>
<input name="username" type="text" class="form-control" id="exampleInputUser3" placeholder="Username">
</div>
<div class="form-group password-field">
<label class="sr-only" for="exampleInputPassword3">Password</label>
<input name="password" type="password" class="form-control" id="exampleInputPassword3" placeholder="Password">
</div>
<button type="submit" class="btn btn-default login-univ-btn">Login</button>
<br>
<i>Forgot Username/Password?</i>
</form>
If I seem like nothing more then an uneducated lost programmer, can you care to send me in the direction to learn?
I'm trying to create a learning/course website like this one.
Actually this form is processed by ColdFusion. ColdFusion does a similar job to PHP where it is a server side scripting language. Here is a good tutorial that will teach the basics of a login system using HTML, MySQL and PHP.
User Membership With PHP
For a more advanced and secure tutorial check this out:
How to Create a Secure Login Script in PHP and MySQL
I am trying to use a wordpress recaptcha plugin.
The plugin (like wp-recaptcah, better Wp recaptcha) that I am trying to use is only working for the comment form.
But in my case I have created a page and there I have inserted HTML that is managed from the admin panel.
I don't understand how I can use the plugin with my form.
I did not get any shortcode HTML tag to use it directly on the page.
Any suggestion how I can achieve this?
I have created a page in the admin panel and inserted this code. My form is submitted via AJAX:
<div class="First"> Here some static Html is used </div>
<form id="main-form">
<div>
<label>Name</label>
<input class="span6" type="text" maxlength="45" name="name" />
</div>
<div>
<label>Email</label>
<input class="span6" type="text" maxlength="45" name="email" />
</div>
<div>
<label>Phone Number</label>
<input class="span6" type="text" name="phone" placeholder="Enter Phone Number" />
</div>
<div>
<label>Message</label>
<textarea class="span12" name="message" rows="6" ></textarea>
</div>
<div><button class="btn >Send Enquiry</button></div>
</form>
<div class="second">Here some static Html is used </div>
Best suggestion: use Contact Form 7 and Contact Form 7 reCAPTCHA Extension or the Really Simple Captcha plugin, both work well with Contact Form 7.
You'll create the form on the CF7 admin page, then insert it into your WordPress page with a shortcode, which, for many reasons, is much better than writing the form itself in the WordPress text view.
You may use reCAPTCHA Form . It give u a form along with the recaptcha.
http://wordpress.org/plugins/recaptcha-form/
or else you may be wanting the following one instead,
http://wordpress.org/plugins/wp-recaptcha/
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to determine if user selected a file for file upload?
I would like a simple PHP form validation. My form has two inputs: A link and a file to upload. The form should be submitted only if the link field is filled and the user selected a file to upload. If one of them is or both are false, an alert box should be displayed (like here when you click Upload without selecting a file).
This is my form:
<form action="upload_file.php" enctype="multipart/form-data" method="post">
<p>Link:<br>
<input type="text" name="link" size="50">
</p>
<p>Image:<br>
<input type="hidden" name="MAX_FILE_SIZE" value="2000000">
<input type="file" name="file" id="file" size="40">
</p>
<div>
<input type="submit" name="upload" value="Upload">
</div>
</form>
I am new to PHP and I have been browsing tutorials for hours now, many of them was of no help or shows the server side validation.
I understand I should start with this:
<form method="POST" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
to validate the fields before the form is submitted. I have some basic knowledge of PHP but I cannot figure out how to do this easy or not so easy task.
php is server side. What you need is a client side checker (js, jq ..)
You can perform the check only with php, but on your server, then return to the client the error message or the task complete message. If you want the check to be done client side, you need a client side language to handle it.
PHP is indeed a server-side application and thus cannot perform client-side validation.
If you really want to do client-side validation, you'll probably have to use javascript. Have a look at the jQuery validation plugin. Here is a big demo page showing you some of the possibilities: http://jquery.bassistance.de/validate/demo/
For more help and information, also have a look at the jQuery.com/plugins/validation page.
(Note the WARNING at the end of this post)
Example:
(the javascript)
<script>
$(document).ready(function(){
$("#commentForm").validate();
});
</script>
(the form)
<form class="cmxform" id="commentForm" method="get" action="">
<fieldset>
<legend>A simple comment form with submit validation and default messages</legend>
<p>
<label for="cname">Name</label>
<em>*</em><input id="cname" name="name" size="25" class="required" minlength="2" />
</p>
<p>
<label for="cemail">E-Mail</label>
<em>*</em><input id="cemail" name="email" size="25" class="required email" />
</p>
<p>
<label for="curl">URL</label>
<em> </em><input id="curl" name="url" size="25" class="url" value="" />
</p>
<p>
<label for="ccomment">Your comment</label>
<em>*</em><textarea id="ccomment" name="comment" cols="22" class="required"></textarea>
</p>
<p>
<input class="submit" type="submit" value="Submit"/>
</p>
</fieldset>
</form>
WARNING
Please keep in mind that javascript, being client-side, runs on the client's computer. Don't rely on javascript validation alone. Anyone can disable javascript and insert 'wrong' values in your form.
In case of form it's best to do client side validation using some javascript library like jQuery. Check out this jQuery tool for form validation.
For server side validation, check out this link. It may help you.
Validation should be done on server side ALWAYS. You can add client minor validation also as a confort for the user with javascript.
Here some basic code to show a message if fields empty using minor validation:
<input type="submit" name="upload" value="Upload" onclick="var ref = document.getElementById('file'); if ( ref.length == 0 ){ alert( 'select file' ); return false; } ref = document.getElementById( 'textfieldid' ); if ( ref.value.length == 0 ){ alert( 'fill link, better use a regexp to match a url but this another store' ); return false; }">
For client side validation of "File upload" field, refer following plug-in :
http://adamsanderson.github.com/jQuery-File-Validator/
It is useful. I have tried it.
I have a confusion, i was going through a blog and in its comment it was suggested that target="_self" is vulnerable. It is true, if yes how we can fix it?
<form action="../process.php" method="post" name="login-form" target="_self">
<div class="FormItem">Username:
<span id="sprytextfield1">
<input class="textbox" type="text" name="text1" id="text1">
<span class="textfieldRequiredMsg">A value is required.</span></span>
</div>
<div class="clear"></div>
<div class="FormItem">Password:
<span id="sprypassword1">
<input class="textbox" type="password" name="password" id="password1">
<span class="passwordRequiredMsg">A value is required.</span></span>
</div>
<div class="FormItem">
<input name="login-submit" type="submit" value="SUBMIT">
</div>
</form>
it has nothing to do with security
the last time i used target, it was just to tell the form where the results are to be displayed, be it in the page itself, an iframe, or another frame in a frameset. as far as i know, it's pretty much useless.
here's a reference from sitepoint, indicating that "target" in forms are deprecated. (Hint: they died with Frameset)
The target attribute is deprecated, and, like the use of frameset for layout purposes, it’s no longer widely used. However, if you do find yourself having to maintain a frameset-based web site, you may wish to present the results of a form submission in a separate frame. For example, you might work with a two-framed page that displays the search form in the first frame and the search results in the second frame, refreshing only the results frame each time the form is submitted.
No target="_self" has nothing to do with it....