function for variable in url
Moderator: General Moderators
-
JosiaMFire22
- Forum Newbie
- Posts: 9
- Joined: Thu Oct 12, 2006 1:12 am
function for variable in url
Hey, I was wondering if anyone could tell me the name of the function that allows you to have like a variable on the end or ur url (eg. http://www.domainhere.com/profile.php?id=JosiaMFire2) - variable would be "JosiaMFire2".
- jayshields
- DevNet Resident
- Posts: 1912
- Joined: Mon Aug 22, 2005 12:11 pm
- Location: Leeds/Manchester, England
It's not a function, it's the GET superglobal array.
-
JosiaMFire22
- Forum Newbie
- Posts: 9
- Joined: Thu Oct 12, 2006 1:12 am
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Re: function for variable in url
JosiaMFire22 wrote:Hey, I was wondering if anyone could tell me the name of the function that allows you to have like a variable on the end or ur url (eg. http://www.domainhere.com/profile.php?id=JosiaMFire2) - variable would be "JosiaMFire2".
Code: Select all
<?php
$id = $_GET['id'];
// For a little cleaner approach
$id = isset($_GET['id']) ? $_GET['id'] : '';
?>