C cgworld Active Member 566 2010 9 30 Oct 19, 2010 #1 So let's say $url = "http://mysite/index.php?page=down&do=search&key=0-9" How to say if "index.php?page=down&do=search&key" all those vars are set ($_GET) then do somethn ? Last edited: Jan 11, 2012
So let's say $url = "http://mysite/index.php?page=down&do=search&key=0-9" How to say if "index.php?page=down&do=search&key" all those vars are set ($_GET) then do somethn ?
B Bread Active Member 192 2009 5 20 Oct 19, 2010 #2 You can do something along these lines $url="your url"; $findme = 'what your searching for'; $pos = strpos($url, $findme); if ($pos === false) { echo "no found!"; } else { echo "it was found! at position ".$pos; } Click to expand...
You can do something along these lines $url="your url"; $findme = 'what your searching for'; $pos = strpos($url, $findme); if ($pos === false) { echo "no found!"; } else { echo "it was found! at position ".$pos; } Click to expand...
L litewarez Active Member 1,367 2008 1 10 Oct 19, 2010 #3 use strstr if(strstr("litewarez","some string that may contain litewarez")) { //would be true }
S sloddl Active Member 1,016 2009 1 30 Oct 19, 2010 #4 if you need it for exactly this url... if($url=='index.php?page=down&do=search&key'){ //do something... } as simple as it gets.
if you need it for exactly this url... if($url=='index.php?page=down&do=search&key'){ //do something... } as simple as it gets.
G Gaurav Active Member 641 2010 104 50 Oct 19, 2010 #5 A little improvement on the code posted by Bread : PHP: $url="your url"; $findme = 'what your searching for'; if(is_numeric(strpos($url, $findme))) { //Your code here }
A little improvement on the code posted by Bread : PHP: $url="your url"; $findme = 'what your searching for'; if(is_numeric(strpos($url, $findme))) { //Your code here }
C cgworld Active Member 566 2010 9 30 Oct 19, 2010 #6 Ok just using ($_GET it can be done) Last edited: Jan 11, 2012