well, i've spent about an hour coding some things, just trying to get a feel for the language...
i'm hoping to eventually get an automated news system with updates via an admin form input... have to figure out files before i can do that, however.
i'm sure this code is rife with errors but if you have some time i'd really appreciate a little help 😃
output:
[][]
[]
[]
code:
<?php
## function declarations
$today = date("m.d.y");
function NewNews ($newstoadd) {
$newstoadd = array ($title, $author, $today, $text);
}
function AddNews ($newstoadd, $news) {
$news[] = $newstoadd;
}
function PrintNews ($news) {
do {
$i = 0;
echo "<B> $news[0][$title] </B>";
echo "<I> $news[0][$author] </I><BR>";
echo " $news[0][$today] <BR>";
echo " $news[0][$text] <BR>";
$i = i+1;
}
while ($i <= count($news));
}
## main program
NewNews($newstoadd);
AddNews ($newstoadd, $news);
PrintNews ($news);
?>
form:
<FORM method="post" action="index.php">
Title
<INPUT type="text" name="title">
<BR>
Author
<INPUT type="text" name="author">
<BR>
Message<BR>
<TEXTAREA name="text" rows=30 cols=80></TEXTAREA>
<BR>
<INPUT type="submit" value="hit it!">
</form>