Personal greeting in comments form

Its nice to greet your visitors with a personal message when they revisit your site. The following is a simple method I use to place a greeting in the comments form.

If the visitor has commented before and their info is “remembered”, then in this example their name will be displayed.

Open your comment_form

Welcome back <txp:php>echo pcs('name'); </txp:php>

Enter the above into your comment_form where you wish the greeting to be displayed. Edit as you see fit.

1 Comments - Comments RSS Feed

Jon-Michael Deldin
# 19 April 2009

To prevent “Welcome back” from appearing for those who haven’t commented, use the following:

<txp:php>
$u = pcs('name');
if (!empty($u))
    echo 'Welcome back, ', pcs('name');
</txp:php>

Add a comment

Required

Required, not displayed

Optional

Use Textile Help to style your comments