# Announcement bar on index.html

**URL:** <https://forum.kirupa.com/t/announcement-bar-on-index-html/255007>\
**Category:** Uncategorized\
**Created:** [March 18, 2008, 6:01am UTC](https://forum.kirupa.com/t/announcement-bar-on-index-html/255007 "2008-03-18T06:01:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dragonknight](https://avatars.discourse-cdn.com/v4/letter/d/a6a055/32.png) [@Dragonknight](https://forum.kirupa.com/u/Dragonknight)\
**Post date:** [March 18, 2008, 6:01am UTC](https://forum.kirupa.com/t/announcement-bar-on-index-html/255007/1 "2008-03-18T06:01:40Z")

</div>

i’m having trouble with this script i made

i want an announcement bar to appear at the top of the page if announcement.txt exists

```php
<html>
<body>
<?
// this is the file to check for
$ourFile = "announcement.txt";
// check for the file
if (file_exists($ourFile))
{
?>
<FONT COLOR="#FF0033"><H2> Announcement </H2></FONT>
<table border="3" bordercolor="#0000FF" background="/images/gradient.jpg" cellspacing=20% width=100%>
<tr>
  <td>
<? readfile($ourFile); ?>
</td>
</table>
<?
} else {
echo("")
}
?>
</body>
</html>

```

heres index.html

```auto

<HTML>
<HEAD>
 <TITLE>Talcrow Game and Art server</TITLE>
</HEAD>
<BODY>
<? include("announcement.php") ?>
Server is currently undergoing maintenance
</BODY>
</HTML>

```

content of announcement.txt

```auto

this is a test file

```
