SunQuest
           Windows Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsWindows Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old July 22nd, 2002, 10:24 AM
spmfreeman spmfreeman is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Posts: 28 spmfreeman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
PHP on windows - problem with script

Hi folks,

I´m just using this php code to send an email:

<?
function MailInfo($myemail){
global $name,$email,$fon,$email,$theme;
global $time,$date;
if(trim("$name") == "")
{ //Verifying input
echo "No name<BR>";
}
if(trim("$fon") == ""){ //Verifying input
echo "No phone entered.<BR>";
}
else
{
//now we mail both recipients only if a name is entered
$your_message = "
Information:\n
Name: $name
E-Mail: $email
Fon: $fon
Theme: $theme
PLZ-Ort: $time
DATE: $date\n";

//Make sure you replace this according to what you want
//the thank you message to say

echo "<B>Thanks </B>.";

$thank_you_message = "
Thank you!";

$extra_headers = "From: $email";
$extra_headers2 = "From: friend@service.ocm";


mail("$myemail","!!! Kontaktformular !!!","$your_message","$extra_headers");
//mail YOU the info
mail("$email","your message","$thank_you_message","$extra_headers2");
//mail thank you email
} //closes if else
}// closes function

function ShowResults ($name) {
MailInfo("sender@mail.com");//replace with your email
} # End of function ShowResults

// Define $data below with $variables you want to write.
// (ex. - $data = $email_address, $name, $phone_number, etc.)
// Make sure that the " " is surounding the variables.

$data = " ";

// You are saveing what is considered personal info, so name file w/ .php extention.
// That way if called direct from browser, it will spill an error and not show the contents.

$fhandle = fopen('path/to/file/log.php', "a");
fwrite ( $fhandle, $data );
fclose ( $fhandle );

// Make sure that the data file is CHMOD to 666 to be writable.
// Put this code at end of mail script.

function ShowForm() {
global $PHP_SELF;
?>

This script works perfectly on linux, but not on windows.
On loading the page you get this error for each variable:

Notice: Undefined variable: name in C:\web\com\mail.php on line 66

How do I have to modify the script that it sends the mails and writes the log?

thanks,
freeman

Reply With Quote
  #2  
Old July 23rd, 2002, 12:01 AM
hucker hucker is offline
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2002
Location: earth
Posts: 337 hucker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 2 m 8 sec
Reputation Power: 7
ive got the same problem in windows, i think the mail() is not supported on windows.
__________________
http://www.zeratool.com

Reply With Quote
  #3  
Old July 23rd, 2002, 02:16 AM
roninblade's Avatar
roninblade roninblade is offline
// no comment
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Dec 2001
Posts: 1,639 roninblade User rank is Sergeant Major (2000 - 5000 Reputation Level)roninblade User rank is Sergeant Major (2000 - 5000 Reputation Level)roninblade User rank is Sergeant Major (2000 - 5000 Reputation Level)roninblade User rank is Sergeant Major (2000 - 5000 Reputation Level)roninblade User rank is Sergeant Major (2000 - 5000 Reputation Level)roninblade User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 4 h 45 m
Reputation Power: 33
you have to setup your own smtp server on windows for the mail script to run.

Reply With Quote
  #4  
Old July 23rd, 2002, 03:23 AM
spmfreeman spmfreeman is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Posts: 28 spmfreeman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
how do we have to change the script to get it working with a smtp account - and how will the log file work?

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsWindows Help > PHP on windows - problem with script


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway