logo
shape

PHP-AJAX Form

PHP-AJAX Form

Raven Pro-v1.0.0 has a built-in universal php-ajax form that can grab dynamic amounts of inputs and send it to any given email address. To make the form work, simply add the class.zform like<form class="zform">.

You can also specify where to send the data via an hidden input:

<input type="hidden" name="to" value="username@domain.extension">
 Other reservedname fields are:subject,email,name
                

See the sample code under the form bellow for better understanding.

<form class="zform pl-3" method="post">
  <div class="form-group">
    <input class="form-control" type="hidden" name="to" value="username@domain.extension">
  </div>
  <div class="form-group row">
    <label class="col-md-2 pl-0 col-form-label text-left">Name :</label>
    <div class="col-9">
      <input class="form-control" type="text" name="name" required="">
    </div>
  </div>
  <div class="form-group row">
    <label class="col-md-2 pl-0 col-form-label text-left">Subject :</label>
    <div class="col-9">
      <input class="form-control" type="text" name="subject" required="">
    </div>
  </div>
  <div class="form-group row">
    <label class="col-md-2 pl-0 col-form-label text-left">Email :</label>
    <div class="col-9">
      <input class="form-control" type="email" name="from" required="">
    </div>
  </div>
  <div class="form-group row">
    <label class="col-md-2 pl-0 col-form-label text-left">Field One :</label>
    <div class="col-9">
      <input class="form-control" type="text" name="field-1" placeholder="Optional">
    </div>
  </div>
  <div class="form-group row">
    <label class="col-md-2 pl-0 col-form-label text-left">Field Two :</label>
    <div class="col-9">
      <input class="form-control" type="text" name="field-2" placeholder="Optional">
    </div>
  </div>
  <div class="form-group row">
    <label class="col-md-2 pl-0 col-form-label text-left">Message :</label>
    <div class="col-9">
      <textarea class="form-control" rows="8" name="message" placeholder="Write your message here..."></textarea>
    </div>
  </div>
  <div class="form-group row">
    <div class="col-9 offset-lg-1 offset-md-2">
      <input class="btn btn-primary px-4 py-2" type="submit" name="submit" value="Send!">
    </div>
  </div>
  <div class="zform-feedback"></div>
</form>

Integrating reCaptcha

Get your secret and site keyhere ⟶

HTML
<form class="zform" method="post">
  ...
  ...
  <div class="g-recaptcha" data-sitekey="YOUR_SITE_KEY"></div>
  <input type="submit" value="Submit">
</form>
JavaScript
<script src="https://www.google.com/recaptcha/api.js"></script>
PHP

Openassets/php/form-processor.php and change the secret key with yours atline: 13

$reCaptchaSecret = "YOUR_SECRET_KEY";

Get latest news
in your box!

Get Special Offers & Deals. We Never Spam.

Made With By ThemeWagon