Drop Shadow

Embedded Comments

If you go to web sites such as the wonderful PHP Manual or news forums on targeted topics, many of them allow registered users to post comments about the pages in question. In the PHP manual, for example, PHP users often post extra tips about how to use a specific PHP feature. On news sites, users post further insight into the news that was reported.

You can embed a comments “forum” into your USD web page if the page is PHP and it is on the www.sandiego.edu host. Only people with a MySanDiego account will be able to post to your comments area.

Enable Comments

The USD page comments system is designed to be a simple, lightweight, page-based forum plug-in. To enable comments, you need to place three sets of lines on your web page.

At the very top of your web page, you need to “include” the comments system:

<? include("/web/includes/comments.php"); ?>

This must be at the very top of your web page. There cannot be any HTML before, nor even any spaces or blank lines. Any stuff above the PHP code listed above might cause comments to display incorrectly over the long term.

Where you want your comments to appear, place:


Normally, you will place this at the bottom of your page.

Finally, you need to include the “stylesheet” for the comments. In a GUI web editor, add “http://www.sandiego.edu/css/pagecomments.css” to the list of style sheets you’re using. In HTML, place the following line in the “HEAD” area of your web page:

<link rel="stylesheet" href="/css/pagecomments.css" type="text/css" media="all" />

Disable Posting

If at any point you want to disable posting but leave the comments in place, add “$allowPosts=false;” as a line above the “include” line. This will prohibit anyone from posting to your comments area.


The comments system uses cascading style sheets to control the appearance of the comments area. You can even leave the style sheet line out of your web page to achieve a very simple, bare-bones look for your comments without affecting the functionality of the comments area. If you want to change the appearance of your comments, you can make your own style sheet by downloading the default style sheet and modifying it.

Reserved Identifiers

If you are also managing your own styles, you must not use the tag identifiers “pagecomments” and “postComment”. You will also want to avoid using targets with those names.


If you have comments or tips for readers of this page, you may post them here. Questions are more appropriately directed to the webmaster. Comment on this page

Protecting non-PHP files

If you need to protect non-PHP files, you currently need to use .htaccess files. See http://help.sandiego.edu/

Protecting non-PHP files

That was pretty stupid, dude.

Protecting non-PHP files

This is interesting. It\'s like candy in a jar.

Protecting non-PHP files Three

Like stealing candy from a monkey.

Protecting non-PHP files Three

It\'s like a fred to a ddead.

Protecting non-PHP files Three

Gorf the lorf

there is

no dorf.

Protecting non-PHP files Three

gorf's the lorf"s what \is this?

Protecting non-PHP files Two

This is pretty cool, dude.

This is all basically PHP

These options are all PHP subroutines and variables.

This is all basically PHP

Here she comes to save the day...

There she goes to reap the hay.

blah blah blah blah blah de lay.


No <a href="evilstuff">here is some evil stuff.</a>

<script language="javascript">