Link to home
Start Free TrialLog in
Avatar of cgi_18
cgi_18

asked on

help meeeeeeeeeee!

I would like a web page has two link - view and post.
Let say I have a file named message.txt.

If user pressed the "post" link, he can post a message by :
  first, enter his name in a textfield.
  second, enter a message in a textarea.
  a button "ok" and a button "clear"
  after he pressed "ok", the message will be saved into   message.txt. when I save the message, it should not   overwrite other message. So the new message will be saved   at the top and the following message is old message. If
  I have 10 user entered the message, then I have 10     messages in the message.txt.

if user pressed "view" link :
  he can view all the messages, so the new message will be   at the top, and followed bt old message.

end.




if you think my idea is not good enough, you can give me
your idea. Also I am new to cgi, I would like a complete
code and detail like how to install the script.

Thank a lot.
Avatar of rajgn
rajgn

Which scripting language you're using for writing CGI?
Avatar of cgi_18

ASKER

perl
this is essentially a blackboard or guestbook script. surf to http://www.cgi-resources.com/Programs_and_Scripts/Perl/Guestbooks/

and look around a little. you would have to modify any of the scripts to fit your need, but all of them provide the ability of adding data to the top of a file and displaying this file (in html format - if you want text, just take out html tags!).

i would love to write a script for you, but due to my limited time available, not even 400 points would be a good incentive. I will help you on your way though!
Avatar of cgi_18

ASKER

Sorry to reject your answer, becasue I change my mind. I would like to post another easy question for you, I think this question is very enough for 200 points :

Ok !, I would like a very simple text counter, must be written by perl

The output is like :
  You are visitor number 1000 today.

I think I have to open the file first, read the number, increment it, store the number back to the file. and close.

But I just don't know how to write in perl.

So I need a complete code . Thank you !
cgi-resources.com will probably help you too!
if you want the counter in text format, then your server has to suport server side includes (unix does, nt sometimes....)
http://www.cgi-resources.com/Programs_and_Scripts/Perl/Access_Counters/

is the url to go to. I can help you on the way again...
what do you want?you cannot simply reject answers and change the topics...
Avatar of cgi_18

ASKER

Yes, I can. Because I said already :
 
  "I would like a complete code and detail like how to install the script." in the first place.
 
and you said 200 points is not very enough, so I just change my question. And I think
the new question is very ok for 200 points, right ?
Also, the script must be your, since you told me to get the script form someone else.
So, It is not your work, I have a right to cancel because I am not happy with your answer.
For example, you're my student, and I told you to find the answer from the book because
I don't have time to explain to you, what is your feeling ? Am I a good prof. ? certainly, no.
that is a way to think about it and it makes me not spend any longer time on this thread. You opened a question asking for code for 200 points (haha what a joke) and I redirect you to the place of all places *and* offer you to help you once you familiarized yourself with the libraries there. You reject my answer (probably because you received the information you needed) and want me to answer another one. I also tell you where to go and offer you to help you once you got familiar with the thing. And you reject it because you want code written by *me* for 200 points. First of all: if there is some library out there that does the trick I am not going to write another one just because *you* think I should. Writing and debugging this could take 4 hours and I am not intending to spend 4 hours for the second question of a 200 pointer thread.
so, have fun finding someone that does this for you, or simply use what I told you and open yet another question. Maybe now you want to do form submittal via email. Would not surprise me if you changed the topic again.
I am going to post a thread in the lounge to let other experts look at your behavior and then you can find out what others think. I am not willing to help you anymore because I need *your* cooperation to solve *your* problem and you are seemingly not willing to provide this.
Avatar of cgi_18

ASKER

for your infomation, I didn't go to
 http://www.cgi-resources.com/Programs_and_Scripts/Perl/Guestbooks/

if I want to, I will seach for "guestbook" in the yahoo, I am sure there is plenty
of source code and it is FREE ! As a matter of fact, if you want, I also
can give you a lot of URL where you can find useful code than the one you gave me.

Also, There isn't rule state that how many point for what degree of question.
Before you answer my question, you should know that I am asking for, "details".
If you think 200 point is very not enough, then just send a comment to me, don't answer
any question if you don't know or the points is not enough.


Avatar of cgi_18

ASKER

for your infomation, I didn't go to
 http://www.cgi-resources.com/Programs_and_Scripts/Perl/Guestbooks/

if I want to, I will seach for "guestbook" in the yahoo, I am sure there is plenty
of source code and it is FREE ! As a matter of fact, if you want, I also
can give you a lot of URL where you can find useful code than the one you gave me.

Also, There isn't rule state that how many point for what degree of question.
Before you answer my question, you should know that I am asking for, "details".
If you think 200 point is very not enough, then just send a comment to me, don't answer
any question if you don't know or the points is not enough.


I am willing to help you, but not just by myself. *you* should look at the code and modify it a little and ask me when you encounter problems.

CGI-Resources is free too and it probably contains the best CGIs on the net. But, do as you like and search for guestbook in yahoo...

>>As a matter of fact, if you want, I also
can give you a lot of URL where you can find useful code than the one you gave me.

sure you can but I don't care anymore. have fun!
cgi_18,
*Help* at this forum doesn't mean that the experts should provide you with their own source code or experience. If they can help you in any way, you should respect their efforts and time. This is not cat-and-mouse game. To be an expert doesn't mean that you have to know the answer of any question - if you don't know the answer, you have to know *how* and *where* to find it.

I think you should award MaDdUCK with the points.

ASKER CERTIFIED SOLUTION
Avatar of MaDdUCK
MaDdUCK

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
MaDdUCK: The question ends with "...I would like a complete
code and detail like how to install the script."

I don't think there is room for discussion here. If you can't or wont provide the code and help that cgi_18 asks for then do not answer the question. There are plenty of experts that are willing to help without laughing at 200 points for code.

If you had just surfed into http://www.cgi-resources.com/Programs_and_Scripts/Perl/Guestbooks/ yourself, picked a relevant piece of code and posted this along with your offer to help, I think cgi_18 would have had a poorer case. As it is now, he/she is in his/her right to reject your answer cause you have not provided the requested information.

NB: This is also posted into (https://www.experts-exchange.com/topics/customerservice/lounge/Q.10094802) -
Can he do this - Yes I think so !!!
okay, i tend to agree on this point, but in this case, I still believe that I am on the right side. my intention was to offer him my help on the way and not to write the code for him. partially, this would help him during the process and he would learn a lot from it. I agree, I could have taken a piece of code and submitted it, but I did not know exactly what he wanted and thus I needed him to include his visions and input while the two of us work on the code. i absolutely do not care about points because i am not here for points. selfishly speaking, i am here to learn from helping...

cgi_18: do you want to settle this whole thing and we will work *together* towards you CGI script(s) fitting your expectations?

NB: This is also posted into (https://www.experts-exchange.com/topics/customerservice/lounge/Q.10094802) but let us continue the thread about "can he do this" in the Lounge question and keep this thread open to related comments...
Now cgi_18, I guess MaDdUCK has proven his good intentions. Give him a chance to help you.
Avatar of cgi_18

ASKER

OK !  MaDdUCK, I am very sorry. But I am very new to cgi. But the source that I get from yahoo, is very very long, I don't think I can understand. And if you teach me along the that
code, I think it will take more than a month. Trust me, I know. Can we start over and forget my question ? The reason I change the 1st ? to 2nd ?, because I think second ? will be shorter than first ? .
 If you accept my apology, please teach me how to write a very simple counter by perl.
 
thank a lot
I was just passing through and I thought I might put my two cents in.

I am using NT4.0 with IIS3 running perl 5.003.
I use the following code. This works for me. But I don't think it is what you want. This will not work on the first(index) page. It is a script that must be (run/executed) from some sort of action, like a form submission.

If the action from a form submission is like this:

   <FORM METHOD=POST ACTION="script.pl">

then script.pl would look like this:
   
   print"HTTP/1.0 200 OK\n";             (If you are using Unix
   print"Content-type: text/html\n\n";    then this would be
                                          #!usr/bin/perl or
                                          whatever is correct for
                                          you.)

   open (FH,"counter");
    $a = <FH>;
    ++$a;
    print "You are visitor $a";
   close (FH);

   open (datafile2, ">counter");
    print datafile2 "$a";
   close (datafile2);

   exit 0;

As far as installing it, just put the script in the same directory as you index page. (I hope you are not talking about installing the perl interpreter, that's a whole other category. But, since you asked for perl code I assume you have perl installed.)

Hope this helps.

P.S. interesting thread... cgi_18, where are you from? just      curious.