Log in

View Full Version : Using a $_GET Function in templates


ForgotenDynasty
11-19-2008, 12:14 AM
Is it possible for me to get retrieve data I attach to the url by using a something similar to the php function "$_GET" in templates?

For example this is what i am trying to do
I want a url such as
www.blah.com/forums/index.php?name=blah

then have a forum where the original value is name
<input type='text' class='bginput' name='to' value="$_GET["name"]">

however the templates dont seem to like the php version :(

Dismounted
11-19-2008, 03:22 AM
You should use the vBulletin Input Cleaner (https://vborg.vbsupport.ru/showthread.php?t=119372) to clean superglobals before using them. When you do that, you can assign a variable to that value, which you can use in your template.

ForgotenDynasty
11-19-2008, 07:15 PM
Ok I can get the variable with an echo command from the php file. But i define the form in the templates. So in order to give it the default value of the cleaned varrible i need to put it in a variable that can be executed from the templates.

if i just use this in the templates
$vbulletin->GPC['cleanedvariable']

I get this in the box
Array[

Dismounted
11-20-2008, 03:48 AM
You need to use curly braces:
{$vbulletin->GPC['cleanedvariable']}