guys I need some help!
I am new to php and as well as Apache 2.0 running on my windows XP.
I recently installed php manually by placing this code in the httpd.conf.
ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php
# For PHP 5
Action application/x-httpd-php "/php/php-cgi.exe"
# For PHP 5 do something like this:
LoadModule php5_module "c:/php/php5apache2.dll"
AddType application/x-httpd-php .php
# configure the path to php.ini
PHPIniDir "C:/php"
i first use this to function my flash mp3 player in php and it works well...
as i want to add a feedback form which code:
<?
/*
CHFEEDBACK.PHP Feedback Form PHP Script Ver 2.04
Generated by thesitewizard.com's Feedback Form Wizard.
Copyright 2000-2005 by Christopher Heng. All rights reserved.
thesitewizard and thefreecountry are trademarks of Christopher Heng.
$Id: phpscript.txt,v 1.4 2005/04/12 10:55:01 chris Exp $
Get the latest version, free, from:
http://www.thesitewizard.com/wizards/feedbackform.shtml
You can contact me at:
http://www.thesitewizard.com/feedback.php
LICENCE TERMS
1. You may use this script on your website, with or
without modifications, free of charge.
2. You may NOT distribute or republish this script,
whether modified or not. The script can only be
distributed by the author, Christopher Heng.
3. THE SCRIPT AND ITS DOCUMENTATION ARE PROVIDED
"AS IS", WITHOUT WARRANTY OF ANY KIND, NOT EVEN THE
IMPLIED WARRANTY OF MECHANTABILITY OR FITNESS FOR A
PARTICULAR PURPOSE. YOU AGREE TO BEAR ALL RISKS AND
LIABILITIES ARISING FROM THE USE OF THE SCRIPT,
ITS DOCUMENTATION AND THE INFORMATION PROVIDED BY THE
SCRIPTS AND THE DOCUMENTATION.
If you cannot agree to any of the above conditions, you
may not use the script.
Although it is NOT required, I would be most grateful
if you could also link to thesitewizard.com at:
http://www.thesitewizard.com/
*/
// ------------- CONFIGURABLE SECTION ------------------------
// $mailto - set to the email address you want the form
// sent to, eg
//$mailto = "youremailaddress@example.com" ;
$mailto = 'dikkis_cybercafe@yahoo.com' ;
// $subject - set to the Subject line of the email, eg
//$subject = "Feedback Form" ;
$subject = "Your Feedback" ;
// the pages to be displayed, eg
//$formurl = "http://www.example.com/feedback.html" ;
//$errorurl = "http://www.example.com/error.html" ;
//$thankyouurl = "http://www.example.com/thankyou.html" ;
$formurl = "http://192.168.1.3/dikkis/feedback/feedback.htm" ;
$errorurl = "http://192.168.1.3/dikkis/feedback/error.htm" ;
$thankyouurl = "http://192.168.1.3/dikkis/feedback/thank_you.htm" ;
// -------------------- END OF CONFIGURABLE SECTION ---------------
$name = $_POST['name'] ;
$email = $_POST['email'] ;
$comments = $_POST['comments'] ;
$http_referrer = getenv( "HTTP_REFERER" );
if (!isset($_POST['email'])) {
header( "Location: $formurl" );
exit ;
}
if (empty($name) || empty($email) || empty($comments)) {
header( "Location: $errorurl" );
exit ;
}
$name = strtok( $name, "\r\n" );
$email = strtok( $email, "\r\n" );
if (get_magic_quotes_gpc()) {
$comments = stripslashes( $comments );
}
$messageproper =
"This message was sent from:\n" .
"$http_referrer\n" .
"------------------------- COMMENTS -------------------------\n\n" .
$comments .
"\n\n------------------------------------------------------------\n" ;
mail($mailto, $subject, $messageproper, "From: \"$name\" <$email>\r\nReply-To: \"$name\" <$email>\r\nX-Mailer: chfeedback.php 2.04" );
header( "Location: $thankyouurl" );
exit ;
?>
and having an html page where the interface of signing the feedback like this:
<html>
<head>
<meta name="Dikkis Cyber Cafe" content="Dikkis Feedback">
<meta name="Author" content="Jayson R. Bayani">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Name</title>
</head>
<body>
<form action="feedback.php" method="post">
<table border="0" cellpadding="8" cellspacing="8" summary="feedback form">
<tr><td>Name:</td><td><input type="text" name="name" size="25" /></td></tr>
<tr><td>Email address:</td><td><input type="text" name="email" size="25" /></td></tr>
<tr>
<td colspan="2">
Comments<br />
<textarea rows="15" cols="45" name="comments">
</textarea>
</td>
</tr>
<tr>
<td align="center" colspan="2">
<input type="submit" value="Send Feedback" /><br />
</td>
</tr>
</table>
</form>
</body>
</html>
upon submitting the feedback this error/warning message appeared and don't know how to deal with it:
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\Program Files\Apache Group\Apache2\htdocs\feedback\feedback.php on line 94
Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\Apache Group\Apache2\htdocs\feedback\feedback.php:94) in C:\Program Files\Apache Group\Apache2\htdocs\feedback\feedback.php on line 95
Any help will gladly appreciate as i said i am really a newbie to php!
thanks!