Okay, this is at least 30 hours worth of trying different combinations of things to discover that for some reason when I apply the CSS rules, it prevents PHP from firing. I've tried nearly all the combinations I can and now need to turn to the professionals.
So I have a simple email script at the top of the page
Code: Select all
<?php
if (isset($_POST['submit']))
{
$field_name = $_POST['name'];
$field_message = $_POST['message'];
$mail_to = 'testaccount@isgaust.net.au';
$subject = 'Message from a site visitor '.$field_name;
$body_message = 'From: '.$field_name."\n";
$body_message .= 'Message: '.$field_message;
$headers = 'From: '.$field_name."\r\n";
$headers .= 'Reply-To: '.$field_message."\r\n";
$mail_status = mail($mail_to, $subject, $body_message, $headers);
if ($mail_status) { ?>
<script language="javascript" type="text/javascript">
alert($field_name);
</script>
<?php
}
else { ?>
<script language="javascript" type="text/javascript">
alert('Message failed. Please, send an email to 'testaccount@isgaust.net.au');
</script>
<?php
}
}
?><h2>Contact form</h2>
<form id="contact-form" action="#?name=test" method="POST">
<div class="success"> Contact form submitted! We will be in touch soon.</div>
<fieldset>
<label class="name">
<input name="name" type="text" value="Name:">
<span class="error">*This is not a valid name.</span>
<span class="empty">*This field is required.</span>
</label>
<label class="message">
<textarea name="message">Message:</textarea>
<span class="error">*The message is too short.</span>
<span class="empty">*This field is required.</span>
</label>
<div class="btns"><a class="button" data-type="reset">clear</a></div>
<input type="submit" name="submit" value="Submit" />
</fieldset>
</form>
So, in the HTML, I have ID="contact-form". The PHP works perfectly with that property removed, but, obviously I want it in there AND the PHP working.
Any ideas???