Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IIS contact form attempt 15

Status
Not open for further replies.

SeanAIX430

Technical User
Jun 29, 2001
189
Hi, I'm consolidating servers and moving part of my website from a FreeBSD box to a 2003 server. I tried to get php installed on my IIS at least 10 times without true success, so I started installing Apache and php together through a couple of programs. All to no avail. I have 2 quick tests that I run on my website to see if php is working. I have an info.php file that will show my php info, but depending on what i have installed I get a can't find page or presently just a blank screen. Then I hit the submit button on my contact form and would like to see it go to the thank you page and send an email but all it does it show:

$Value) $MsgBody .= "$Field: $Value\n"; $MsgBody .= $Divider . "\n" . $HTTP_USER_AGENT . "\n"; $MsgBody = htmlspecialchars($MsgBody); //make content safe // Send E-Mail and Direct Browser to Confirmation Page mail($SendTo, $SubjectLine, $MsgBody, "From: " . $SendFrom); header("Location: $ThanksURL"); ?>

on the page. So I know the form works on my FreeBSD box and the issue lies within my 2003 server and getting php to work with either IIS or apache. I've tried easyphp.org, i've downloaded php5 from php.net and followed the instructions to the letter, and on my latest apache install I can open their phpinfo.php file and have it show up correctly but neither of my files function correctly. Any ideas? I'm going crazy!
 
forget it, i'm not sure why, but i needed to include php in my code rith after the initial >? at the start of the file. I just looked at the code in the phpinfo.php versus my info.php and that was the only difference. When i added it to my contact form it worked. Now I have to get smtp setup and working.
 
So with apache and PHP working on my 2003 server, how do I get email to be sent out successfully? I found these two errors in my apache log:

[Wed Feb 15 15:23:11 2006] [error] [client 192.168.1.27] PHP Notice: Undefined variable: HTTP_USER_AGENT in C:\\ on line 27, referer: [Wed Feb 15 15:23:11 2006] [error] [client 192.168.1.27] PHP Warning: mail() [<a href='function.mail'>function.mail</a>]: SMTP server response: 550 5.7.1 Unable to relay for patrick@domain.com in C:\\ on line 31, referer:
Do I have to allow realying to my exchange server from that apache server IP address?
 
Well even though the response rate has been a little lower than I'm used to from this great site, I'm just updating that I figured out to edit my php.ini {mail} section to point to my exchange server to send the contact form successfully.
Now I have to build a web survey, so I'm sure I'll be back asking about some of the fields.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top