Connecting Tech Pros Worldwide Help | Site Map

How to get complete URL Referer

 
LinkBack Thread Tools Search this Thread
  #1  
Old December 13th, 2008, 04:50 PM
Newbie
 
Join Date: Aug 2007
Posts: 17
Default How to get complete URL Referer

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

Last edited by eWish; December 13th, 2008 at 08:38 PM. Reason: Removed "BOLD" tags. Please do not make your entire post bold.
Reply
  #2  
Old December 13th, 2008, 08:36 PM
eWish's Avatar
Moderator
 
Join Date: Jul 2007
Location: Arkansas
Posts: 898
Default

For the query sting use $ENV{'QUERY_STRING'} which will get your everything past the '?'

--Mork
Reply
  #3  
Old December 13th, 2008, 08:53 PM
KevinADC's Avatar
Expert
 
Join Date: Jan 2007
Location: Southern California USA
Posts: 4,031
Default

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.
Reply
  #4  
Old December 13th, 2008, 09:07 PM
eWish's Avatar
Moderator
 
Join Date: Jul 2007
Location: Arkansas
Posts: 898
Default

This is very true and it is easy too.

--Mork
Reply
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.