Solved

help meeeeeeeeeee!

Posted on 1998-10-28
19
177 Views
Last Modified: 2013-12-25
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.
0
Comment
Question by:cgi_18
  • 8
  • 6
  • 2
  • +3
19 Comments
 
LVL 1

Expert Comment

by:rajgn
ID: 1829329
Which scripting language you're using for writing CGI?
0
 

Author Comment

by:cgi_18
ID: 1829330
perl
0
 
LVL 8

Expert Comment

by:MaDdUCK
ID: 1829331
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!
0
 

Author Comment

by:cgi_18
ID: 1829332
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 !
0
 
LVL 8

Expert Comment

by:MaDdUCK
ID: 1829333
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....)
0
 
LVL 8

Expert Comment

by:MaDdUCK
ID: 1829334
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...
0
 
LVL 8

Expert Comment

by:MaDdUCK
ID: 1829335
what do you want?you cannot simply reject answers and change the topics...
0
 

Author Comment

by:cgi_18
ID: 1829336
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.
0
 
LVL 8

Expert Comment

by:MaDdUCK
ID: 1829337
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.
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:cgi_18
ID: 1829338
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.


0
 

Author Comment

by:cgi_18
ID: 1829339
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.


0
 
LVL 8

Expert Comment

by:MaDdUCK
ID: 1829340
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!
0
 
LVL 1

Expert Comment

by:Bonev
ID: 1829341
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.

0
 
LVL 8

Accepted Solution

by:
MaDdUCK earned 200 total points
ID: 1829342
FYI: http://www.experts-exchange.com/Q.10094802

But my offer to help you once *you* familiarize yourself still exists.
0
 
LVL 12

Expert Comment

by:Trygve
ID: 1829343
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 (http://www.experts-exchange.com/topics/customerservice/lounge/Q.10094802) -
Can he do this - Yes I think so !!!
0
 
LVL 8

Expert Comment

by:MaDdUCK
ID: 1829344
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 (http://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...
0
 
LVL 12

Expert Comment

by:Trygve
ID: 1829345
Now cgi_18, I guess MaDdUCK has proven his good intentions. Give him a chance to help you.
0
 

Author Comment

by:cgi_18
ID: 1829346
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
0
 
LVL 1

Expert Comment

by:johnsm
ID: 1829347
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.


0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction:   Welcome to my first article ever. To begin with, the reason I write this article.  I participated in a question on Experts Exchange about the start command in Windows and there were some discussion about the usage. The discussio…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now