# HELP show the messages in descending order

**URL:** <https://forum.kirupa.com/t/help-show-the-messages-in-descending-order/203914>\
**Category:** flash\
**Created:** [October 15, 2006, 3:38pm UTC](https://forum.kirupa.com/t/help-show-the-messages-in-descending-order/203914 "2006-10-15T15:38:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![max23](https://avatars.discourse-cdn.com/v4/letter/m/c89c15/32.png) [@max23](https://forum.kirupa.com/u/max23)\
**Post date:** [October 15, 2006, 3:38pm UTC](https://forum.kirupa.com/t/help-show-the-messages-in-descending-order/203914/1 "2006-10-15T15:38:29Z")

</div>

hi, I cannot show the new messages in the first place in this book of visits .help please. thanks

[http://usuarios.lycos.es/cameron23/](http://usuarios.lycos.es/cameron23/)

**[COLOR=DarkGreen]DOWNLOAD THE SOURCE [[COLOR=Red]HERE[/COLOR]](http://www.kirupa.com/forum/attachment.php?attachmentid=39389&d=1160612625)[/COLOR]**

```php

<?

//No need to edit anything below here.
if (!isset($name) || !isset($email) || !isset($message) || empty($name) || empty($email) || empty($message)) {
print "&result=Fail";
print "&errorMsg=" . urlencode("Input required for all fields.");
exit;
}

$email = strtolower($email);

addentry($name, $email, $website, $message);

function addentry($name, $email, $website, $message) {

$posted = strftime("%D %I:%M %p");

$message = stripslashes($message);

$file = fopen('entry.txt', 'a+');

if (!$file) {
print "&result=Fail";
print "&errorMsg=" . urlencode("Could not open entry.txt file. Change CHMOD levels to 766.");
exit;
}
 
fputs($file, "<font color=\"#11396D\">Name:</font> $name
<font color=\"#11396D\">Email:</font><font color=\"#666666\"><A href=\"mailto:$email\"> $email</A></font><br>
<font color=\"#11396D\">Website:</font><font color=\"#666666\"><A href=\"http://$website\"target=\"_blank\"> $website</A></font><br>
<font color=\"#11396D\">Posted:</font> $posted
<font color=\"#11396D\">Message:</font> $message

");
fclose($file);

// Send admin an email when new entry occurs
mailAdmin($name, $email, $website, $message);
}

function mailAdmin($name, $email, $website, $message) {
    $mailTo = "you@yoursite.com";
    $mailFrom = "From: <you@yoursite.com>";
    $mailSubject = "New Guestbook Entry";
    $mailBody = "A visitor to your site has left the following information in your guestbook:

    Name: $name
    Email: $email
    Website: $website
    The visitor commented:
    ------------------------------
    $message 
    ------------------------------
    You can view the message at:
    http://www.yoursite.com";
    mail($mailTo, $mailSubject, $mailBody, $mailFrom);
    mail($email, "Your Subject", "Thank you message", "From: you@youremail.com");
}

print "&result=okay";
exit;

?>

```
