Forum Moderators: coopster

Message Too Old, No Replies

REQUEST URI help

         

thegreatpretender

12:10 pm on Jun 17, 2007 (gmt 0)

10+ Year Member



This is my present code:

$a="100";
$pageurl = $_SERVER['REQUEST_URI'];
$caturl = strpos($pageurl, $a);
if ($caturl == true){
$b="1";
}

The above will return 1 for $b because the url has "100".

But now I have many variables and really having a hard time doing it.

My variables now are: 100, 200, 300, 400, 500, and
different outcomes on $b, ie. 1, 2, 3, 4, 5.

example, if "200" is found on url, $b would be "2" etc.

Thanks for your help.

Habtom

12:20 pm on Jun 17, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I read your post again and again, but couldn't understand what you wanted out of it. What is missing and what do you have as input? Little more info.

thegreatpretender

3:11 pm on Jun 17, 2007 (gmt 0)

10+ Year Member



Thanks for your reply.

What I want to do is to find a number in a requested URL.
Exampale, if the url contains "100", I would like the value of variable $b to "1"; If contains "200", the value of $b would be "2" and so on.

Thanks again.

eelixduppy

3:13 am on Jun 18, 2007 (gmt 0)



What is the format of the url going to be like? Where is the number going to be? If it is going to be the first numeric character in the uri string then it will be cake ;)