# Trying to create a logging system

I am trying to create a logging system simaler to this site. I don't need all the bells and whistles, just want to add posts to a thread. I can't seem to make it update the new page with the edited information? can anybody help

Last edited by a moderator:

Related Computing and Technology News on Phys.org
crap I just started html and now I have to learn another language
what is CGI? http://www.jmarshall.com/easy/cgi/ I have read through this and still am unable to accomplish anything. I am not trying to make a web page that runs on an internet server. Just a log book that will add logs similar to the way you have on this site, on my computer. I may be misunderstanding but does the cgi program have to be on a server with a URL? Is there anyway to fool a normal computer into adding information to a html page like this or is it some major learning curve?

CGI is the common gateway interface. People usually use PERL with CGI. You must run the website on a server to accomplish your needs. I must say it is a very large learning curve if you don't know html and want to move into a server language. Your best bet is to buy some books at barnes and noble and take a few months to learn web technologies.

I can't believe there isn't an easy way to have stuff added to a simple page. HTML is for the most part simple unless you want to get crazy. Like have the form just add to the file like a paste function. This is driving me crazy. For example, when I press submit reply button on here it goes to a php or a cgi type then that file gets and then posts onto the proper page it is rather crazy how it works simple but yet not. If I want to add to a page I made I can edit and resave and there is the new text. But If I want other people to add they don't want to know html, they just want to click and type and click and there is there log. I just think it is crazy that there isn't a simple way or a compiler that will do this. Thanks though I am just frusterated.

Well, there is !
If you need very customized things, you will need to learn and learn and learn (and this is why programmers come up , to do this for you).
But if you don't really care about anything special, you just need your objective done, you can use free ready codes, like (for example) if you are welling to have some forums, see the snitz forums ! http://forum.snitz.com , those will need a server that supports ASP, if you have a good budget go buy a ASP supporting host (like http://www.readyhosting.com ), if not, try to use a free ASP supporting host (like http://www.brinkster.com ).

And, if you have a good budget (i mean, a VERY good one), and need something customized, and don't want to learn, you might find some good coders easily online at http://www.rentacoder.com .

Greg, is it against the rules to redirect people on the forums to other sites ?

Last edited by a moderator:
Originally posted by STAii
Well, there is !
If you need very customized things, you will need to learn and learn and learn (and this is why programmers come up , to do this for you).
But if you don't really care about anything special, you just need your objective done, you can use free ready codes, like (for example) if you are welling to have some forums, see the snitz forums ! http://forum.snitz.com , those will need a server that supports ASP, if you have a good budget go buy a ASP supporting host (like http://www.readyhosting.com ), if not, try to use a free ASP supporting host (like http://www.brinkster.com ).

And, if you have a good budget (i mean, a VERY good one), and need something customized, and don't want to learn, you might find some good coders easily online at http://www.rentacoder.com .

Greg, is it against the rules to redirect people on the forums to other sites ?
ok I bought a domain and we will see what this is about

Last edited by a moderator:
hey that looks just like the old phf

If you bought the domain with a hosting plan, did u check that the host supports what you are going to use (ASP or PHP) ?
hey that looks just like the old pf
Yes, the old PF was based on the Snitz forum, actually ALL the time there was a little link on the right bottom corner of EVERY page linking back to the site i gave you , but it seems only few people noticed that.

yea checked it out and it does support everything I need, I am just trying to learn so we will see how well I do. I am haveing so many ideas run through my head now on what to do with the site I am getting confused, but its fun. I never saw that link on the old phf eather, I suppose because just the topics alone were enough to give me brain drain, trying to figure out why about everything can be distracting

ok I downloaded snits and crap I am lost, I have to change some directories and make a database so that it will work. very confusing[?]

I downloaded a guestbook and installed it but can't seem to get it to work, I am not sure if its in the cgi or what, what is cdmod?

Chmod is the unix command used to set permissions on files and folders. Permissions such as read and write, Again, I highly recommend you buying some books on these subjects if your serious about using web technologies.

You could always use a free embedded guest book and stick it in a html frame I have done this with satisfactory results.

Search google for 'Free guestbooks'. There maybe even be free forum type software you can link into your site. Hmm that gives me an idea ...

EDIT: This looks quite promising :http://www.theguestbook.com/

Ok thanks a lot, I am on my way. This has been a great learning experiance for me:)

Physicist.persianblog.com

see my weblog for your resources.....

use this www.mamboserver.com...

PHP CMS... very good and GNU...

If you want a PHPBB use this www.phpbb.com/

Which is what this site is built on (?)

All you need is Liunx, PHP, MYSQL, Apache...

Here's a script I wrote to create a simple message board for my website. It can be viewed here: http://www.hell0.com/shout.php .
PHP:
<html>
<body>

<pre>
<a href="index.html">h  o  m  e</a>
</pre>
<form action="<?php echo $_SERVER['PHP_SELF']?>" method="POST"> <textarea name="message" rows="20" cols="60" wrap="virtual"></textarea> ascii art? <input type="checkbox" name="ascii" /> <br><input type="submit" value="hell0 it" /> </form> <br> <?php /********************************************************************************************************* Sh0ut/hell0 it! is a simple message posting script written in PHP that does not requires only a text file Copyright (C) 2004 Alex Beal This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *********************************************************************************************************/ if(@$raw_message=rtrim(strip_tags($_POST['message']))) //check for string in shout { /*FORMATTING STRING*/ if(strlen($raw_message)>2000) //if over 2000 characters truncate and format
{
$fmessage = "\n<hr> " . substr($raw_message,0,2000) . '<p>Message truncated to 2000 characters' . '<!--' . $_SERVER['REMOTE_ADDR'] . '-->'; } else { //if under 2000 characters just format$fmessage = "\n<hr> " . $raw_message . "<!--" .$_SERVER['REMOTE_ADDR'] . "-->";
}
if(@$_POST['ascii']) //if ascii art then insert <pre> tags into$fmessage
{
$fmessage = substr_replace($fmessage,'<pre>',0,0) .'</pre>';
}

/*WRITING STRING TO DATABASE FILE*/
umask(077); //make the file 077 permission
$messagedb=fopen("shout", "r+"); flock($messagedb,2); //stop file from being messed up
$old_data = fread($messagedb, filesize("shout")); //get all stuff from the file (old data)
rewind($messagedb); //to to beginning fwrite($messagedb,"$fmessage". "$old_data"); //write new stuff then add old data
flock($messagedb,3); //perissions back fclose($messagedb); //close file
}

/*DISPLAY MESSAGE DATABASE*/
echo '<tt>'; //needed to format ascii art corretly
include "shout";
echo '</tt>';
?>

<p><b><font size="-3">Sh0ut/hell0 it! V2.3.1</b> Alex Beal (C) 2004. Released under the <a
href="[PLAIN]http://www.gnu.org/copyleft/gpl.html">GNU[/PLAIN] [Broken] GPL</a>.</font>
</body>
</html>
The way it works is it stores the messages to a text file in the same directory that the script is located. When a person wants to see the messages it spits out the text file. It's written in PHP and will need a PHP enabled host.

There are several problems with it. First, if someone spammed it a lot the text file that stores the messages could become very very large. Also, if many people post messages at the same time the file containing the messages could become mangled. I tried to prevent that with the "flock()" call.

Files:
Linux Windows