Testing Spry form on local server and redirecting to a 'thank you' page
Hello,
I'm building a site in DW CS6 using PHP and testing on my local server (MAMP).
I'm wanting to create a simple contact form so people can submit a message which will then be sent to one email address (my first time doing this).
Using tutorials and a bit of code from our hosting provider I've written the code below.
Is there a way that I can now test that this works on my local server? I also want to create a thank you page that people will be redirected to.
When I view the form in a browser, the CSS styling is working but I don't know if it works because when I roll over the submit button it doesn't seem active/change and when I click on it nothing happens - I just stay on the same page, rather than being directed to another page.
I'm not sure if I've gone about this the right way.
I realise that I'll have to redirect the path for the 'thanks' and 'error' pages at the bottom to my local MAMP htdocs folder, but I'm not given the option to browse for these files and just shown the 'bind to dynamic source' icon.
<form method="post" action="http://www.our_domain.co.uk/cgi-bin/FormMail.pl" accept-charset="ISO-8859-1" onsubmit="var originalCharset = document.charset; document.charset = 'ISO-8859-1'; window.onbeforeunload = function () {document.charset=originalCharset;};">
<span id="nameTextField">
<label for="name"></label>
<input type="text" name="name" id="name">
<span class="textfieldRequiredMsg">Required</span></span><br><br>
<span id="emailTextField">
<label for="email"></label>
<input type="text" name="email" id="email">
<span class="textfieldRequiredMsg">Required</span><span class="textfieldInvalidFormatMsg">Invalid format</span></span><br><br>
<span id="messageTextArea">
<label for="message"></label>
<textarea name="message" id="message" cols="45" rows="5"></textarea>
<span id="countmessageTextArea"> </span><span class="textareaRequiredMsg"> Required</span><span class="textareaMinCharsMsg">Minimum number of characters not met.</span><span class="textareaMaxCharsMsg">Exceeded maximum number of characters.</span></span><br><br>
<input name="submit" type="button" value="Send">
<input type="hidden" name="recipient" value="enquiries@our_domain.co.uk" />
<input type="hidden" name="subject" value="Enquiry from your website" />
<input type="hidden" name="redirect" value="http://www.our_domain.co.uk/thanks.php" />
<input type="hidden" name="missing_fields_redirect" value="http://www.our_domain.co.uk/error.php" />
<input type="hidden" name="required" value="realname,email," />
</form>
Thank you
