Skip to content
WJunction - Webmaster Forum

PHP Help needed

Status
Not open for further replies.
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:

5 comments

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;

}
 
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

}
 
Status
Not open for further replies.

About the author

C
Active Member · Joined
566
Messages
9
Reactions
18
Points

Advertise on WJunction

Reach 1000's of webmasters, hosts & affiliates. Banner & sponsored-thread slots available.

Contact us
Back
Top Bottom