Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Using $_GET

Posted on 2006-11-24
4
263 Views
Last Modified: 2008-03-06
Experts,

I am currently using the $_GET method to extract a variable from a url.  The url looks as follows;

http://www.something.com/process.php?var=1

I can take out the variable 1, however I would like to implement the following to pull out a user id;

http://www.something.com/process.php?var=1&id=username

How can this be achieved?
0
Comment
Question by:nickmarshall
  • 2
  • 2
4 Comments
 
LVL 13

Expert Comment

by:rhickmott
ID: 18006802
$var = $_GET['var'];
$username = $_GET['userame'];


Or am I missing somethign here? You can specify as many GET varibles as you want and reference them by their index in $_GET
0
 
LVL 6

Accepted Solution

by:
aescnt earned 250 total points
ID: 18006886
Yes rhickmarshall, a minor oversight: it's $_GET['id'], 'username'.

Look at your URL:
   ?var=1&id=username
That reads: "var" is "1", and "id" is "username".

Maybe:
   $var = $_GET['var'];
   $username = $_GET['id'];
0
 
LVL 13

Expert Comment

by:rhickmott
ID: 18006905
Apologies for the spelling mistake ;)

I'm not the same person as the original poster :)

0
 
LVL 6

Expert Comment

by:aescnt
ID: 18007223
Oh hehe sorry. :)
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question