Category Archives: Web Authoring Links

Filtered by Tag: PHP (unfilter)

Send Calendar Invitations with PHP

The first problem is sending mail from PHP from a smpt server that requires authentication. The standard php.ini file does not allow that. Fortunately, there is fake sendmail for windows which is included in the xampp installation. This requires modification of both the php.ini [mail function] section as well as the sendmail.ini file where the server authentication information is stored. With these modifications, the php mail function will work!

The primary problem is how to configure an e-mail attachment with a proper calendar invitation. This was kindly explained at Exchange Core. This seems to work not only with messages sent to an Exchange server, but also when sent to standard imap servers when viewed with a client that understands what to do with .ics attachments, such as the iPad. Awesome!

See also, iCalendar on Wikipedia and the iCalendar specification at the Internet Engineering Task Force.

New PHP Project & Name Parsing

Thinking about developing a mysql database for help with case management in my firm. Learned alot by using XAMPP and the excellent PHP Development Series video tutorials at Lecture Snippets.

Jonathon Hill‘s PHP Human Name Parsing, improving Keith Beckman’s script.

Jason Priem’s page about parsing human names in PHP.

Here is the same type thing in javascript by Josh Frasier.

Another javascript name parser by Jerry Davidson.

Chris West’s blog post about javascript name parsing.

Style Sheets for Printing

Modified the paralegal internet research page, to display answers to the lab problems after a code is given in a form. Used a php header statement to redirect to the print page if the correct code was given.

I freaked out a little. After doing a lot of work to get this page to work correctly, I tried to print the hand out. The print-out looked nothing like what displayed on screen. The answers were not indented, the font color was missing, the automatic numbers were gone.

Turns out, it was a problem with my stylesheet reference. I had been using

<link rel=”stylesheet” type=”text/css” href=”http://www.glenpritchard.com/css/global-styles.css” media=”screen”>

The problem was ‘media=”screen”‘. I did not know that you can specify different style sheets for printing and on-screen viewing. Specifying ‘media=”screen”‘ means that the style sheet will be used for what is displayed on the screen and not what prints.  Using ‘media=”print”‘ will work for printing, but not anything else. To use the same style sheet for all purposes, ‘media=”all”‘ may be used.

W3C has a nice reference about style sheets. It also has a reference about media types.

Update: Because the style sheets are cascading, there was no need to redirect the research page to a separate print template. The same page can be used for screen and print! For future reference, the redirect code, which must go at the top before the <html> tag,  looks like this:

<?php
if($_GET[“code”]==”reject4053″) {
header(“Location:http://www.glenpritchard.com/paralegal/print.php”);
}
?>