I have added a form with a google recaptcha to a module which I have displayed on my home page only, the form and the module appear to be working fine, it's just this notice for the google recaptcha that's annoying me now. The recaptcha appears to work fine.
Code: Select all
Notice: Undefined index: route in /home/dolphdes/public_html/catalog/controller/extension/captcha/google_captcha.php on line 18
Code: Select all
$data['route'] = $this->request->get['route'];
I lifted the form pretty much directly from the contact page files, making use of the contact us language file as well.
Code: Select all
<!-- Contact form --!>
<div id="contact-form" class="home-contact-form">
<div class="home-contact-form">
<form action="" method="post" enctype="multipart/form-data" class="form-horizontal">
<fieldset>
<legend><?php echo $text_contact; ?></legend>
<div class="form-row">
<div class="form-group required" id="home-form-name">
<label class="col-sm-2 control-label" for="input-name"><?php echo $entry_name; ?></label>
<div class="col-sm-10">
<input type="text" name="name" value="<?php echo $name; ?>" id="input-name" class="form-control" />
<?php if ($error_name) { ?>
<div class="text-danger"><?php echo $error_name; ?></div>
<?php } ?>
</div>
</div>
<div class="form-group required" id="home-form-email">
<label class="col-sm-2 control-label" for="input-email"><?php echo $entry_email; ?></label>
<div class="col-sm-10">
<input type="text" name="email" value="<?php echo $email; ?>" id="input-email" class="form-control" />
<?php if ($error_email) { ?>
<div class="text-danger"><?php echo $error_email; ?></div>
<?php } ?>
</div>
</div>
</div>
<div class="form-row">
<div class="form-group required" id="home-form-enquiry">
<label class="col-sm-2 control-label" for="input-enquiry"><?php echo $entry_enquiry; ?></label>
<div class="col-sm-10">
<textarea name="enquiry" rows="5" id="input-enquiry" class="form-control"><?php echo $enquiry; ?></textarea>
<?php if ($error_enquiry) { ?>
<div class="text-danger"><?php echo $error_enquiry; ?></div>
<?php } ?>
</div>
</div>
</div>
<div id="captcha">
<?php echo $captcha; ?>
</div>
</fieldset>
<div class="buttons">
<div class="pull-right">
<input class="btn btn-primary" type="submit" value="<?php echo $button_submit; ?>" />
</div>
</div>
</form>
</div>
</div>
<!-- End contact form --!>
The module was an existing Testimonial one which works fine (after I made a few tweaks, it had a few bugs in the admin side not related to the form and also customised it for my own needs), it displays a testimonial on the left with a form on the right. I see no reason why these two things shouldn't be able to exist in a single module, they share the index function in the controller, the only problem is with the recaptcha. I would have made them two separate modules but couldn't see a way to lay them side by side on a single row using the existing OpenCart page layout design.
Any help with what might bring on such a notice? I've looked online and found stuff relevant to forms made as part of the home page or information pages but not as a module on the home page, I don't know if that would make a difference, none of it helped. I'm sure it's just something silly that I've missed.
Thank you in advance.