Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
How to get the particular value from url
jana
Hi Everybody,
I am trying to get the particular value from the link but it is not coming. I have the url like:
http://sample.com/video/?fr_story=123asd33de12&rf=bm
i want the value 123asd33de12.
Can any one help me to do this.
Thanks in advance.
Find more posts tagged with
Comments
Vip777
--------Use following script-------
use CGI;
my $uri_string = '
http://sample.com/video/?fr_story=123asd33de12&rf=bm';
my $data = (split(/\?/,$uri_string))[1];
my $q = new CGI($data);
print $q->header;
my %data = $q->Vars;
#!print map {"$_ = $data{$_}$/"} (keys %data);
print "$data{'fr_story'}\n";
Rick Poulin
Vip's script is great at seeing all of the params and headers that are passed to your script for debugging. If you know your param names ahead of time, you may want to use the simpler
my $frStory = $q->param('fr_story');
Crosstab3.7.rptdesign
jana
I got the answer i use this code
$vedio_id="url which i given";
my
@video_array=
split(/\=/ , $video_id);
my
@video_array1=split(/\&
;/,$video_array[1]);
new_report.rptdesign
Rick Poulin
That will work until you find a URL-encoded entity in your parameter value. Might not be the case today, but it's not robust for tomorrow.
jana
Yah you are right but my param value is changing frquently, and i have different urls in which i have to get the value of particular value. So i used that code.