quote:
Originally posted by toddy
why would you want new shouts at the top??
you'd have to have the input field at the top too, other wise u would mean that you'd have to view it on full window, or keep scrolling down to add new shouts.
yeah i managed to move the input field at the top too
i want the new ones ontop so i dont have to keep clearing it if it gets to long, it will just scroll for ages but the newest ones will be on view
heres the indexy one
code:
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body style="overflow-x:hidden;overflow-ycroll;">
<//------- Start copying from this point -------->
<table class="shoutBox">
<tr><td class="shoutBox">
<p class="heading"><b>.:: ShoutBox ::.</b></p>
<p>
<center>
<form name="shoutForm" method="POST" action="addShout.php">
Name: <input type="text" name="user" size="15"><br>
Shout: <input type="text" name="shout" size="15"><br>
<input type="submit" value="Send!">
</center>
<hr>
<?php
$fp = fopen("shouts.txt","r");
while(($shout = fgetcsv($fp,1000,":")) !== FALSE) {
echo "<b>".$shout[0]." : </b>".$shout[1]."<br>";
}
fclose($fp);
?>
</p>
</form>
</td></tr>
</table>
<//------- Finish copying from this point -------->
</body>
</html>
And heres the 'Add shout.php' one
code:
<?php
/* -------------------------------------------------------
ShoutBox v1.1
By: Mark Lethbridge, 2007
-------------------------------------------------------
Install notes:
Only thing that needs to be changed in this file is the
line: $shoutbox_page = "index.php";
You simple change "index.php" into the correct page
that the shoutbox will appear in.
-------------------------------------------------------- */
$fp = fopen("shouts.txt","a");
fwrite($fp,$_POST['user'].":".$_POST['shout']."\n");
fclose($fp);
$shoutbox_page = "http://pps3.awardspace.com/Shoutbox/index.php";
header("Location: $shoutbox_page");
?>