Firefox can't find the file at /C:/Users/Rachel/Documents/New Site/contact.php.
My form is from this tutorial ( i will personalize it once I can get it working)
My contact page is called page5.html and has this code:
Quote:
<!DOCTYPE HTML PUBLIC
"-HTTP:WSC??DTD HTML 4.01 Transitional//EN
"http://www.w3.org/TR/xhtml1-transitional.dtd">
<html xmlns="http xmlnx="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" type"text/css
href="main.css" />
<title>
Rachel Clare's Services
</title>
</head>
<body>
<div id="content">
<!-- Begin Header -->
<div id="header">
</div>
<!-- Begin Left Column -->
<div id="leftcolumn">
<div id="navcontainer">
<h2>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="page2.html">Portfolio</a></li>
<li><a href="page3.html">About</a></li>
<li><a href="page4.html">Services</a></li>
<li><a href="page5.html">Contact</a></li>
</ul>
</div>
<br><br><br>
<form method="post" action="contact.php">
Nickname:<input type="text" name="nickname" />
<br/><br/>
Your e-mail: <input type="text" name="visitormail" />
<br/><br/>
Topic: <input type="text" name="topic" />
<br/><br/>
Message: <br/><textarea name="message" rows="10" cols="50"></textarea>
<br/><br/>
<input type="submit" value="Send" />
</form>
</div>
<!-- End Left Column -->
<!-- End Header -->
<!-- Begin Footer -->
<div id="footer">
Copyright © Rachel Clare Photography 2009
</div>
<!-- End Footer -->
</div>
</body>
</html>
|
and my contact.php file is in the same folder as the page5.html and the code is ( I left the comments in from the tutorial so I know what it all means-I didnt think this would cause the problem this cause the problem?:
Quote:
<?php
//first we check if $_POST['nickname'] , $_POST['visitormail'] , $_POST['topic'] , $_POST['message'] exist, then we check if they are empty or not.
if (!empty($_POST['nickname']) && !empty($_POST['visitormail']) && !empty($_POST['topic']) && !empty($_POST['message']))
{
//We deactivate possible html tags
$nickname = htmlspecialchars($_POST['nickname']);
$visitormail = htmlspecialchars($_POST['visitormail']);
$topic = htmlspecialchars($_POST['topic']);
$message = htmlspecialchars($_POST['message']);
//We transform new lines into <br>s
$message = nl2br($message);
//we define the variable:
//$mail contains the email address of the recipient (admin)
$mail = 'rachelsne@hotmail.com';
//$topic is the topic of the message
$topic = '' . $topic . '';
//Then $mess is the message
$mess = '<html><body>Message from ' . $pseudo . ' --> ' . $visitormail . '<br/><br/>' . $message . '</body></html>';
//These headers are very important to send html mail using HTML
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
//Finally we send the mail thanks to the mail() function
mail($mail, $topic, $mess, $headers);
//and we say to the visitor that the mail has been send
echo 'Your message has been sent !';
?>
|
What am I missing or doing wrong? or does it only work when I am actuall live through my host? right now I am just opening test pages in firefox
|