plz help me in making of a script

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 in making of a script

Post by sehrawat350 »

hello brothers

i have to make a new php script to grab the last number of a url

for example

Code: Select all

http://www.example.com/index.php?id=34
so this script grab the 34 number

i want to make this script but i dont have much knowledge of php

plz tell me how to start writng this script

thanks
User avatar
Sofw_Arch_Dev
Forum Commoner
Posts: 60
Joined: Tue Mar 16, 2010 4:06 pm
Location: San Francisco, California, US

Re: plz help me in making of a script

Post by Sofw_Arch_Dev »

Code: Select all

 
<?php
 
$foo = null;
if( isset( $_REQUEST[ "id" ] ) ) {
    $foo = $_REQUEST[ "id" ];
}
 
?>
 
A book on PHP Web Development will be money well spent.
siji86
Forum Commoner
Posts: 30
Joined: Fri Mar 26, 2010 6:15 am

Re: plz help me in making of a script

Post by siji86 »

Hi,

You can use the following $_GET['id'] in your php script inorder to get the value of id in the $_GET variable.

:D
learnerabn
Forum Commoner
Posts: 48
Joined: Wed Feb 10, 2010 12:56 am

Re: plz help me in making of a script

Post by learnerabn »

Tell me what type of website do you want to develop?
Post Reply