Solved

Using $_GET

Posted on 2006-11-24
4
271 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
[X]
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
  • 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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone 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

Suggested Solutions

Title # Comments Views Activity
MSSQL - Lock Row from reading by other programs 9 61
Wordpress and Wufoo 1 39
while read ID; do 4 56
How do I Enable submit button only if listbox has items 4 33
Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.

733 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