Jump to content

PHP if-else-then, wildcards. Would they work and How?


monkeytooth

Recommended Posts

Ok I have a custom 404 error page. And one of the common setbacks, drawbacks, whatever you wanna call it is, when implemented they catch everything even the stuff the server would have ignored prior.

 

My Common error is MS Office users. By defualt there browsers through an addon with MS Office looks for:

 

/MSOffice/cltreq.asp?UL=1&ACT=4&BUILD=6254&STRMVER=4&CAPREQ=0

/_vti_bin/owssvr.dll?UL=1&ACT=4&BUILD=8164&STRMVER=4&CAPREQ=0

 

(as an example...)

 

And I achieve finding that out via $_SERVER['REQUEST_URI'];

So That said How would I find just:

/MSOffice/cltreq.asp?UL=

/_vti_bin/owssvr.dll?UL=

 

and if found do something else with it, what I ultimately want to do is ignore it, as my error page sends me a email for ever error, and well thats starting to flood my box more often then less.

 

Guess my problem is if its possible I cant figure out where I would put a wild card to throw out the rest past the UL= part.. or am I just looking at this wrong and can I just get a variable to define what I want based off the URI and then go from there? I have no idea, im burnt, help me :-)

 

$str = '/MSOffice/cltreq.asp?UL=1&ACT=4&BUILD=6254&STRMVER=4&CAPREQ=0';

list ($firstbit) = explode ('=', $str);

echo $firstbit;                            // --> /MSOffice/cltreq.asp?UL 

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.