plz help me how to grab a apecific number froam a page

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sehrawat350
Forum Newbie
Posts: 3
Joined: Fri Mar 19, 2010 6:41 pm

plz help me how to grab a apecific number froam a page

Post by sehrawat350 »

hello iam new to php

but i have a little bit knowledge of php

i want to make a script which grab last number of a url

for example

posting.php?mode=post&f=1

here i want to grab the last number [in this case it is 1]

plz help me

thanks in advance

note : URL TO GRAB THESE NUMBERS IS ENTERED BY THE USER
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: plz help me how to grab a apecific number froam a page

Post by Christopher »

For URLs those values are in the superglobal array $_GET. For Forms the values are in the superglobal array $_POST. So your two parameters will be in $_GET['mode'] and $_GET['f'].

Remember that these values cannot be trusted and should be filtered and validated before being used.

PS - no need for all bold ...
(#10850)
uu31z
Forum Newbie
Posts: 3
Joined: Fri Mar 19, 2010 8:44 pm

Re: plz help me how to grab a apecific number froam a page

Post by uu31z »

try this $_REQUEST["f"]
Post Reply