I have a single email field form on a static, 1 page html website which upon submitting, I would like it to pass the entered email to a WordPress install to use as an email for a new account. The html website and the wordpress website are on different domains. Can WordPress handle this without a custom plugin?
I have the html of my form from the static website below:
<form action="signup.php" id="contact_form" method="post" onsubmit="return validateForm();">
<ul>
<li class="email">
<p class="white">Just enter your email to start. Easy, with spam-free goodness.</p>
<input type="text" name="email" id="email" value="Enter your e-mail" class="requiredField email" onblur="if(this.value == '') { this.value = 'Enter your e-mail'; }" onfocus="if(this.value == 'Enter your e-mail') { this.value = ''; }" />
<p class="whitesmall">Add additional details later, no credit cards required!</p>
</li>
<li class="button"><input id="submitted" class="input-submit" type="submit" value="Sign Up" name="submit" />
</li>
</ul>
</form>
Upon Submission, I have a javascript function which validates the email entered:
<script type="text/javascript">
function validateForm()
{
var x=document.forms["contact_form"]["email"].value;
var atpos=x.indexOf("@");
var dotpos=x.lastIndexOf(".");
if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)
{
alert("Please supply a valid e-mail address");
return false;
}
}
</script>
The form action sets some variables and shoots me an email of the submitted email address:
<?php
$email_to = "[email protected]";
$emailSubject = 'User Account Submission from xxxxxxxxxxx';
$email = $_POST["email"];
$text = "Email: $email<br>";
header("Location:http://xxxxxxxxxxx.com/signup.html");
mail($email_to, $emailSubject, $text);
?>
How would I instead: 1) send this to WP so that WP can use the email to create an account 2) have wp setup a temp password 3) and then email the new account+pass to the user?
I'm still a beginner when it comes to customizing WordPress and am not sure the best way to go about sending WP the form?
Any help or insight on the proper places to look would be appreciated!