×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

can CGI prog activate a pre-built web page

can CGI prog activate a pre-built web page

can CGI prog activate a pre-built web page

(OP)
Hello everyone,
I'm sorry to be a pain AND a newbie but rather than create a webpage from the CGI program [dynamic content - as I understand it the reason for CGI] could the program just return a pre-built page. e.g. if the IP of the client HAS previously logged in then the CGI could check his log-in status and if OK point them to a page?

Hmmm! I think I might be missing something here???

Thanks
Ian t

RE: can CGI prog activate a pre-built web page

While the content may be static, what you are doing is still dynamic because it's event driven. Yes, a cgi script could check some type of a status, a login status if you will, and then do something based on the status.

The simplest script would check if a user is logged in and allow them access to the site/content if they are, and redirect to a login screen if they are not.

- Kevin, perl coder unexceptional!

RE: can CGI prog activate a pre-built web page

(OP)
Thanks for your speedy reply. Being new to this area may I ask how to accomplish this. i.e. what would the CGI do to send the client to another page?
cheers

RE: can CGI prog activate a pre-built web page

There are a few ways to redirect users, the simplest being a meta refresh tag.

CODE

<meta http-equiv="refresh" content="2;url=http://www.example.com">


But this does not restrict access, only redirects the user to another site/page.

If you need to restrict access you really need to use some type of authentication, generally a username and a password.

- Kevin, perl coder unexceptional!

RE: can CGI prog activate a pre-built web page

turnbui and Kevin

if I understand the question correctly

(I often get confused)

I have a script I downloaded from some free script archive

That allows storage on my site but it makes a pre-set index page for each user
 
And checks the ip of user to the logged ip but it has a setting to turn this off. Now in my use I did for some people are still on dialup and ip’s change

MA WarGod

I believe if someone can think it, it can be programmed

RE: can CGI prog activate a pre-built web page

(OP)
Again, thanks for a speedy reply and the good info.

As you've probably guessed I am looking at authentication.
Initially the user coming to my site is presented with index.html that is a form for username/password. If nothing is entered or invalid user [checked against a MySQL DB tey get no further.All's well with the universe.

From your prevous answer you've guessed I'm having probs at this point, ie when a valid user comes in. Your first answer mentioned "allow them access to the site/content if they are"
a. how does ths happen and
b. wouldn't I have to force a CGI that checks them on every page they may then visit?

As I'm using Apache I could simply use the built in .htaccess but for purposes of learning I'd rather carry on with my CGI stuff with a lot of help from people like yourself if you don't mind.
Besides I don't like the Log-on screen that .htaccess throws up?!?
hoe you don't mind sharing your knowledge?

Thanks

RE: can CGI prog activate a pre-built web page

(OP)
Thanks for the info MAWarGod.
I'm using C and I think you're talking Perl or PHP?

RE: can CGI prog activate a pre-built web page

Unfortunately I do not know C pogramming at all. You are to the point where you need nuts and bolts examples of code I believe. You may want to ask in the C forum if nobody can offer more assistance here. Most of the CGI programmers are perl people, but there are a few python, C/C++, ruby, etc people too. But I think your best bet is to ask in the C forum even though you will be running in a CGI environment. The CGI part is really simple (a form on a webpage), it's the backend C stuff that I can't help with.

- Kevin, perl coder unexceptional!

RE: can CGI prog activate a pre-built web page

You can also search a script archive site like hotscripts:

http://www.hotscripts.com/C_and_C++/index.html

there are probably already some C scripts that you could use or modify or learn from.

- Kevin, perl coder unexceptional!

RE: can CGI prog activate a pre-built web page

(OP)
Exceptional KevinADC, many thanks for taking time to give me info and the links. Totally appreciated.
Cheers, I'll go have a look.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close