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

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -