php - Extract Text from HTTP referer -


i using following code show referer link page on website. how can modify code shows part of link. i.e if website url www.example.com/?s=printing want extract printing. , should happen if format www.example.com/?s=aaa , not if format else www.example.com/printing.

code:

<?php  session_start(); if ( !isset( $_session["origurl"] ) ) $_session["origurl"] = $_server["http_referer"];  echo $_session["origurl"]  ?> 

i figured out , following code works:

<?php      session_start();     if ( !isset( $_session["origurl"] ) )     $_session["origurl"] = $_server["http_referer"];      $mysearchterm = $_server["http_referer"];      $whatiwant = substr($mysearchterm, strpos($mysearchterm, "=") +1);         echo  $whatiwant;  ?> 

Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -

r - Update two sets of radiobuttons reactively - shiny -