PDA

View Full Version : Guestbook



nets
29-12-2005, 12:37 AM
I'm coding a guestbook using PHP and JavaScript.
I want to have some sort of BB code and display stats about the guestbook at the bottom. Once I've made the script I'll post it on here so you can all use it (if you want, not that you will).

I haven't been working on it long, but I'll post some of it:


<?PHP
$filename = "datafile.txt";
$date = date('D,M,Y');
$open = fopen($filename, 'r+');
$datecheck = fread($open, 1);
if($datecheck=="")
{
$createdate = "$date\n";
fwrite($open, $createdate);
echo "Thanks for choosing to use this guestbook, refresh the page and it *should* be ready to use.";
exit;
};
fclose($open);

$file = file($filename);
foreach($file as $key => $rowdata)
{
$data[$key] = explode("|", $rowdata);
$ents++;
}
$ents--;
while($row < sizeof($file))
{
/*Data out puts*/
$row++;
};

Just for testing purposes:

echo 'Created on: '.$data[0][0].'<br />';
echo "Current entries: $ents";

Dan Williamson
29-12-2005, 12:40 AM
Should be good :)

I'm taking it your bored again :p

- Dan

nets
29-12-2005, 12:48 AM
I'm taking it your bored again :p

Yep :eusa_shif

Dan Williamson
29-12-2005, 12:49 AM
Yep :eusa_shif

Lol poor poor you!

- Dan

nets
29-12-2005, 06:29 PM
Haven't done much since, done some JavaScript and made a message editor with BB code.

http://www.joshh.co.uk/examples/guestbook/editor/

Luckyrare
29-12-2005, 06:47 PM
Its looking good... ;)

nets
29-12-2005, 06:50 PM
Its looking good... ;)
Thanks.
Also I'm assumeing you tried to access http://www.joshh.co.uk/examples/guestbook/.
Its not up yet, but I'll release it when it is.

Anderman
29-12-2005, 07:40 PM
I think you've took the long way around designing this,
All it really needs is one form to submit the data into the mysqlt
And about 7 lines of php code to display the data from the table

BBcode and a admin panel would be pretty easy to add

nets
29-12-2005, 07:46 PM
I think you've took the long way around designing this,
All it really needs is one form to submit the data into the mysqlt
And about 7 lines of php code to display the data from the table

BBcode and a admin panel would be pretty easy to add
I don't want to use MySQL.

pechie100
29-12-2005, 07:48 PM
Yep :eusa_shif
lol
poor nets
you can do some stuff for me ?

Luckyrare
29-12-2005, 07:58 PM
Thanks.
Also I'm assumeing you tried to access http://www.joshh.co.uk/examples/guestbook/.
Its not up yet, but I'll release it when it is.

You no me so well "_"

nets
29-12-2005, 07:59 PM
lol
poor nets
you can do some stuff for me ?
What do you want?

:Blob
29-12-2005, 08:07 PM
Dont work for me "/


www.txryan.info/test.php

nets
29-12-2005, 08:09 PM
Dont work for me "/


www.txryan.info/test.php
Because the script isn't finished, and the part I've done up to so far is working fine.

Created on: Thu,Dec,2005
Current entries: 0

:Blob
29-12-2005, 08:31 PM
ohh


how do you make a thing that sends a message?

Want to hide these adverts? Register an account for free!