DaemonForums  

Go Back   DaemonForums > Miscellaneous > General software and network

General software and network General OS-independent software and network questions, X11, MTA, routing, etc.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 8th May 2008
drhowarddrfine drhowarddrfine is offline
VPN Cryptographer
 
Join Date: May 2008
Posts: 377
Default Can't get PATH_INFO using getenv()

I'm running a small C test app that just prints out environment variables. It prints out REMOTE_ADDR but PATH_INFO is null and PATH_TRANSLATED is empty. Essentially, this is all it is.

#include <stdlib.h>
#include <stdio.h>

int main(void){
char* status;

status=getenv("PATH_INFO");
printf("%s",status);
}
Reply With Quote
  #2   (View Single Post)  
Old 8th May 2008
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Tcpdump Spy
 
Join Date: Apr 2008
Location: Netherlands
Posts: 2,243
Default

Is your PATH_INFO actually set? It isn't set on my system, but if I set it, it will properly print the value.
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
  #3   (View Single Post)  
Old 8th May 2008
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,318
Default

Quote:
Originally Posted by drhowarddrfine View Post
It prints out REMOTE_ADDR but PATH_INFO is null and PATH_TRANSLATED is empty.
How does this compare to the output of env(1)?
Reply With Quote
  #4   (View Single Post)  
Old 8th May 2008
drhowarddrfine drhowarddrfine is offline
VPN Cryptographer
 
Join Date: May 2008
Posts: 377
Default

Yeah, apparently it's not set. I can use request_uri instead. It's a shared host so I only have access to htaccess. Does that mean I can't set it? I mean get path_info to show? Can I use env?

Last edited by drhowarddrfine; 8th May 2008 at 05:46 PM.
Reply With Quote
  #5   (View Single Post)  
Old 8th May 2008
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,318
Default

Try it & find out.
Reply With Quote
  #6   (View Single Post)  
Old 8th May 2008
drhowarddrfine drhowarddrfine is offline
VPN Cryptographer
 
Join Date: May 2008
Posts: 377
Default

And work at it? You want me to think?!!!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
mod_rewrite and path_info problem drhowarddrfine General software and network 1 7th May 2008 04:25 PM


All times are GMT. The time now is 11:43 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick