PDA

View Full Version : Passing Variables to a Template


Hwulex
07-12-2002, 02:50 PM
Ok, I'm making this new hack, and it's all done, sorted, finito, apart from this one niggly little bit.

I need to insert some text, say $bbuserinfo[text] into the message box on a reply. So in the template, I've got:

<input type="button" class="bginput" value="button" title="button" accesskey="m" onclick="smilie('$bbuserinfo[text]')" onmouseover="stat('button')">


Sooo. Why does onclick="smilie('$bbuserinfo[text]')" not work?

If I put a value in the brackets like onclick="smilie('Insert This')" it works.

So, it would seem to me, that the template isn't receiving $bbuserinfo[text], and I don't know why. If I echo $bbuserinfo[text] in the php file, it outputs fine. :-\

I tried putting it in a seperate template to get it to work, but failed completely on that count too :p :(

Please help :dead:

Neo
07-12-2002, 03:14 PM
Make sure that variable has a value to it.

Hwulex
07-12-2002, 03:53 PM
It was defined, as echoing it worked.

Doesn't matter now anyway, I've fixed it :)

Cheers for the reply.


Mods please close :)