Sunday, January 09, 2005

Why is PHP so fickle?

I'll be the first to admit that computer progamming is not my strongest suit. I've personally built the website for Outskirts Press out of necessity more than desire. Now that I have help with graphics and our current transition to a larger, more rubust SQL database that will be integrated off-line with Access, I'm still surprised by how like things likes "platform migrations" can alter a 100% fully-funtioning site into a pile of goo.

Said "goo" ocurred when the migration finalized (see my blog from two posts ago). Two things happened. For one, more than half our CGI programs began failing because I made an itsy bitsy error in the coding which, for some reason, was fine with the previous host but was unacceptable to this one (a later version of Perl, presumably.)

See if you can find the mistake from these 6 lines of CGI. (We had to find the error from among 2,000 lines):

-- well -- nevermind, this blog isn't going to let me cut and paste code in here.

If you said, "That 'at' thingy in the email address needs a 'slashy' thingy" then congratulations, you win.
So once we resolved that (and random other incongruities in some of the programs, that -- honestly -- didn't make any sense to me) in the 60 individual CGI programs used within the OP site, we were back in business, with the exception of mail function from PHP.
If I know this much CGI then I know this much PHP .
As a result, finding the error in the CGI was much simpler because my understanding was/is broader. I'm still trying to figure out the problem with our sendmail in PHP, and that's my daily frustration for the day. Yes -- I have one of those every day. Will I have a heart attack at 40 or 39? Any guesses?
So, in the interest of seeking help, here's the PHP problem:
info@outskirtspress.com>"; $subject="Outskirts Press - Thank you for registering!"; $mime_boundary="==Multipart_Boundary_x".md5(mt_rand())."x"; $headers = "From: $from\r\n"; $headers.= "From: $from\r\n"; $message = \n\n"; if (mail($to, $subject, $message, $headers)) echo "";?>