We help IT Professionals succeed at work.
Get Started

Applying a URL variable to a form element

Last Modified: 2012-05-08
There is no doubt I am overlooking something very obvious, but I just don't seem to get it.  I need to be able to take a url variable and enter it in as the value of a hidden form element.  I have tried both javascript and php and I am just missing something.  The url variable would be 1234 as in http://www.domain.com/index.php?id=1234, or with javascript http://www.domain.com/index.html?id=1234.

I am trying to get that variable into something like
<input type="hidden" name="ID" value=<?php $_get('id') ?> />

What am I doing wrong?
Watch Question
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE