User not logged in - login - register
Home Calendar Books School Tool Photo Gallery Message Boards Users Statistics Advertise Site Info
go to bottom | |
 Message Boards » » CGI question Page [1]  
Raige
All American
4386 Posts
user info
edit post

Is there a way to JUST get the page you access? I know you can use cgi.PATH_TRANSLATED to get you the full server path but I was hoping to find something that just gets the page.

It's not a big deal but it would be useful for something I'm trying. (specific page meta data for a variable driven 10 page website).

11/17/2006 10:57:33 AM

tjoshea
All American
4906 Posts
user info
edit post

perhaps you could use some clever regex to stip just the last file name out of the path

11/17/2006 11:50:32 AM

Raige
All American
4386 Posts
user info
edit post

I'm just going to use the full path translated in the identifying query. Not as sleek as I want but it works. The goal of this was to load up meta data fields with specific information depending on the page.

It works well. Check it out

http://www.ncc-nbaf.org

11/17/2006 2:16:19 PM

qntmfred
retired
40562 Posts
user info
edit post

nice diagonal gradients

[Edited on November 17, 2006 at 3:38 PM. Reason : i can't read]

11/17/2006 3:32:59 PM

Bakunin
Suspended
8558 Posts
user info
edit post

you're using some framework built on top of CGI, not "CGI", and not knowing what framework that is pretty much rules out any hope of anyone answering your question

but to do this in a CGI script or binary application without a framework, you'd find everything you need in the environment variable QUERY_STRING, but of course you'll need to parse it to seperate the path from the paremeters (split at '?', e.g.)

11/18/2006 12:10:36 AM

Raige
All American
4386 Posts
user info
edit post

lol you know what I meant.

I thought about parsing it just for the page but it just wasn't worth the time to do it and the fact that it would have to process that every page. Instead I just use the full path. No sense taking an extra step.

11/18/2006 11:44:25 AM

Noen
All American
31346 Posts
user info
edit post

wow, it actually looks pretty clean too, GG Raige

11/18/2006 12:37:11 PM

philihp
All American
8349 Posts
user info
edit post

you want either SCRIPT_FILENAME or SCRIPT_NAMEhttp://www.comptechdoc.org/independent/web/http/reference/httpcgivars.html

11/19/2006 1:24:49 AM

Bakunin
Suspended
8558 Posts
user info
edit post

actually yeah QUERY_STRING is wrong, my bad

11/19/2006 9:07:37 PM

 Message Boards » Tech Talk » CGI question Page [1]  
go to top | |
Admin Options : move topic | lock topic

© 2024 by The Wolf Web - All Rights Reserved.
The material located at this site is not endorsed, sponsored or provided by or on behalf of North Carolina State University.
Powered by CrazyWeb v2.38 - our disclaimer.