How can I create a variable that is pulled from a URL like the one below?

eg: http://www.example.com/page.php?Item_ID=774&score=42

Need to pull the number "42" from the url and placed into a form which is then emailed by the user.

up vote 10 down vote accepted

Use Mo' Variables. It will give you access to GET variables like this {get:your_key} (in your case {get:score}).

Mo' Variables has many other uses, as well!

  • Amazing extension. Thanks so much! – Kevin Zych May 24 '14 at 4:34
  • @alex Is using this plugin the only way to achieve this? – Andrew Jan 27 '15 at 23:32
  • If we're talking templates... your alternative options are 1) possibly another plugin with similar function, or 2) make your own plugin. 3) you could enable PHP in the template and use some PHP, but you are better off making a simple plugin instead or just using Mo' Variables. – Alex Kendrick Jan 28 '15 at 5:30

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.