Click to See Complete Forum and Search --> : 2 questions:


MastahUK
02-20-2003, 10:33 AM
1. What scipt do I need so that the number of times a file has been downloaded can be remembered and shown next to the link?

2. (a little more complicated) How would I go about having a comments system on my site, so that you fill out a simple form with your name, email and the actual comment and it gets submitted into a new cell as a comment. I have seen this on many sites and have no idea how it is made.

Thanks in advance :)

pyro
02-20-2003, 10:39 AM
Both of these will need to be done with a server side language such as PHP, Perl, etc...

MastahUK
02-20-2003, 10:42 AM
Im already using php for my site (you showed me how yesterday :)) so i will try and use that then. Could you help me out or is this not your forté?

pyro
02-20-2003, 10:51 AM
Sure, I can help you out...Just let me know when you have questions...

MastahUK
02-20-2003, 10:58 AM
This is all I have so far for my comments section, and I dont know where to put it or how to link it to the html form:

<?php
$recipient = "webmaster@mastahuk.com";
$subject = "Response";
$mailheader = "From: <$_POST["email"];>\n";
$mailheader .= "Reply-To: <$_POST["email"];>\n\n";
$message = "Sender's name: $_POST["name"];\n";
$message .= "Sender's favorite color: $_POST["color"];\n\n";
mail($recipient, $subject, $message, $mailheader) or die ("Failure");
?>

I got this code from somewhere, but I'm not too sure if this is meant to post the comments within the .php page or if it will email me with the comments (which I do not want).

question: Where do I put it and how can I make it work generally? :P

pyro
02-20-2003, 11:09 AM
That little snippet will email the comments to you, so you can forget about that... ;)

What you are going to have to do is write the users comments to either a database or a flatfile. You can then read through the database or flatfile and get the users comments out and print it to your pages.

MastahUK
02-20-2003, 11:22 AM
You said:

Originally posted by pyro
What you are going to have to do is write the users comments to either a database or a flatfile. You can then read through the database or flatfile and get the users comments out and print it to your pages.

All I see is:

technical jibberish

Could you please try and dumb this down a bit for me? I am already using my only database on my site and I dont know what you mean by a flatfile.

pyro
02-20-2003, 11:28 AM
For you database, you could probably use the same database and just add another table to it...

A flatfile would just be a simple .txt file or something that will hold all the data. You will need to separate entries with something like a pipe (|), and you can then split the text file at each pipe and write the page...

MastahUK
02-20-2003, 11:34 AM
Thanks for trying to explain but I still do not have a clue what you are on about :confused:.

Do you have any examples so I can at least know what you mean? A problem that this method (what I think I understand of it) is that I will have this comments script for each file in my downloads section and this .txt file you are referring to would not be able to handle this would it?

pyro
02-20-2003, 11:44 AM
I personally havn't made any examples, but you may be able to find one here http://php.resourceindex.com/Complete_Scripts/Chat/Shoutbox/

MastahUK
02-20-2003, 01:18 PM
The link you gave me contained shout boxes, which are a different thing to what I am after. I am trying to do what is at the bottom of this page:

http://www.planetquake.com/lvl/comments.asp?id=1492

Like this site, I would also like to have a comments section at the bottom of each page. I have not found anything useful to do with this yet.

Please help - links would be nice and script would be even nicer :)