Posted by:
Brenton
(---.126.125.91.dyn.plus.net)
First of all let me thank you for your response, it was much appreciated, with regards to PHPMYADMIN, I tried typing in the address bar, [
127.0.0.1], and managed to get to the correct page, I then received your response and checked the HOSTS file and sure enough, there was a number of entries reading '127.0.0.1 localhost' and one entry of '::1 localhost' I changed this to '127.0.0.1 localhost' and sure enough the link from the menu now works as does the link from the 'Server Configuration' page. With regards to the other issue of PHP, I have created another folder within the 'WWW' folder but I am still getting the raw data. Just to try and clarify what I was trying to do, I'll include the lines from the HTML file which reads,
<form action="contact.php" method="post">
Your name<br>
<input type="text" name="cf_name"><br>
Your e-mail<br>
<input type="text" name="cf_email"><br>
Message<br>
<textarea name="cf_message"></textarea><br>
<input type="submit" value="Send">
<input type="reset" value="Clear">
</form>
The contents of the PHP file:
<?php
$field_name = $_POST['cf_name'];
$field_email = $_POST['cf_email'];
$field_message = $_POST['cf_message'];
$mail_to = 'brenton123@hotmail.co.uk';
$subject = 'Message from a site visitor '.$field_name;
$body_message = 'From: '.$field_name."\n";
$body_message .= 'E-mail: '.$field_email."\n";
$body_message .= 'Message: '.$field_message;
$headers = 'From: '.$field_email."\r\n";
$headers .= 'Reply-To: '.$field_email."\r\n";
$mail_status = mail($mail_to, $subject, $body_message, $headers);
if ($mail_status) { ?>
<script language="javascript" type="text/javascript">
alert('Thank you for the message. We will contact you shortly.');
window.location = 'contact.html';
</script>
<?php
}
else { ?>
<script language="javascript" type="text/javascript">
alert('Message failed. Please, send an email to
brenton123@hotmail.co.uk');
window.location = 'contact.html';
</script>
<?php
}
?>
This works perfectley well on the web site (Hosted).
Which is why I cannot understand why it is not working outside the hosted web site. Is there something simple I am missing or is there a specific way to make it work under WAMP?
Once again I thank you for your response.