CGI Programs

Supermercado

Diamond Member
Jan 18, 2002
5,893
0
76
Hi, all. First post in this forum, but I've got a question that I'm hoping someone here knows the answer to. I'm working on a website that will be updated somewhat frequently with news posts, not just by myself, although the site is being hosted on my webspace. Rather than giving other people access to my space, I want them to be able to post news, as well. In school this last year, we did a little bit of programming in Perl and did a little bit of work with CGI scripts. What I'm wanting to do is code a few programs that will allow these users to login with a username and password and then post news on the main page of the site. I will be writing it in Perl, since that's what I know.

I've been thinking about it and I'm not sure about how to approach a particular aspect of the problem. I want to execute a program right away (i.e., when the site loads up) that will go into my directory structure and retrieve X number of news posts and then generate the main page of the site based on what data was retrieved from the file. My question is this: How do I cause this program to execute when the site loads, rather than having to have the user do something to start execution of the program? The only thing I've come up with so far is to use the onLoad attribute of the HTML BODY tag and have that execute the program, but I don't know if that will do what I want it to do. Any help would be most appreciated.
 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
(a) frames (one or more frame source = CGI)
(b) redirect from index.htm to mainpage.cgi
(c) PHP ? (if it works like ASP, can use scripting to build the response page)
(d) JSP
 

Supermercado

Diamond Member
Jan 18, 2002
5,893
0
76
Someone I know suggested option (b), more or less. He actually suggested that I write a CGI program and call that index.cgi and see if that would load when the website loads, provided there was no index.html. Do you know if that would work?

If not, do you know right offhand how to do a redirection? I assume that's done with standard HTML.
 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
no idea on the index.cgi and might depend on how Apache is set up.

here's a redirect, with extra spaces in < tag > so forum software doesn't drop it.

< HTML >
< HEAD >
< TITLE > Loading please wait < /title >
< META HTTP-EQUIV=REFRESH CONTENT="0;URL=http://www.respondus.com/index.shtml" >
< /HEAD >
< BODY >< /body >
< /html >
 

Supermercado

Diamond Member
Jan 18, 2002
5,893
0
76
Awesome. Thanks. I'll have to try that out. I guess I could just put that on my index.html that would point to a index.cgi and code up index.cgi to do what I want.
 

hamburglar

Platinum Member
Feb 28, 2002
2,431
0
0
For your first problem, I think your should try php-nuke. here It allows registered users to post, and it has a whole bunch of other stuff you can do. But it takes a while to install, at least for me. Im a newbie :eek:
 

Kazi

Senior member
Jun 7, 2001
637
0
0
you can do alot with php-nuke. my site has been made using php-nuke and its lookin pretty good if you ask me hehe :D You can do all kinds of things with it.