By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,933 Members | 1,675 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,933 IT Pros & Developers. It's quick & easy.

How to get complete URL Referer

P: 30
Hello:

Im working on a script that needs the complete URL referer to proceed accordingly to variables included after the question mark on the previous URL.EXAMPLE

Expand|Select|Wrap|Line Numbers
  1. cgi-bin/myscript.pl?first_variable=YES
But the following Environment Variable

Expand|Select|Wrap|Line Numbers
  1. $ENV{'HTTP_REFERER'}
Only prints the URL up to the question mark

Any Ideas..??

VirtualWeb
Dec 13 '08 #1
Share this Question
Share on Google+
3 Replies


eWish
Expert 100+
P: 971
For the query sting use $ENV{'QUERY_STRING'} which will get your everything past the '?'

--Mork
Dec 13 '08 #2

KevinADC
Expert 2.5K+
P: 4,059
What you want is to use the CGI module to parse the query string. There are a lot of security issues running scripts as a CGI and blindly importing everything sent via 'post' or 'get' or other method is unwise.
Dec 13 '08 #3

eWish
Expert 100+
P: 971
This is very true and it is easy too.

--Mork
Dec 13 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.