Jump to content

Search for word inside of main window URL


lynxus

Recommended Posts

Hi,

I have a problem with frames and php.

 

I have a page that has a bunch of frames inside it.

Inside one of those frames i have some php code that does stuff. However i want it to check if something exists inside the url of the main windows URL.

 

IE:

The main windows url = http://Moooooooo.com/login.html?ChangeMe|||||||||0|0|0||SomeWord|1|0

 

Then inside that main window is a frame with bla.html and some php code in it.

In blaa.html i want to look at the main URL and say, if it finds SomeWord inside that big url is prints one thing and if it doesnt it does something else.. Maybe if tru set $var = "1" else "0"

 

Sorta like lest say..

 

$var = "0";

if ($url of main window contains "SomeWord") {

          $var = "1";

          }else{

          $var = "0";

          }

 

 

Any ideas???

 

Thanks so much

Graham

try this:

 

<?php

$var1 = $_SERVER['QUERY_STRING'];
$lookN4="SomeWord"; // Word You Want To Search For

if (preg_match("/$lookN4/i", $var1)) 
{
echo "Query String Did Contain \"$lookN4\".";
}
else {
echo "Query String Did <b><u>Not</u></b> Contain \"$lookN4\".";
}

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.