passing a php smarty varable to the tpl page before it is compiled

I have a php page say abc.php which has a tpl page that is compiled off the abc.tpl which cretes abc.tpl.php and i have a varable $_GET['sel'];
and am trying to access this varable in a if statment ie
{if $_GET['sel']  == 'lib'}  ****** this syntax is not correct but what i need how to extract the passed varable to a pre compiled tpl page this the correct synatax to extract the varable $_GET['sel']

{ /if}
but cannot get the program to compile and if i can get it to compile i cannot access the varable.
any ideas pleaes
sydneyguyAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Sudaraka WijesingheWeb Application ProgrammerCommented:
I think what you are looking for is $smarty.get
See http://www.smarty.net/docsv2/en/language.variables.smarty.tpl for more details.

{if $smarty.get.sel == 'lib'}
	{* do something here *}
{/if}

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sydneyguyAuthor Commented:
bingo perfect thanks for the imput exactly what i was looking for
Sudaraka WijesingheWeb Application ProgrammerCommented:
Glad to help. Thanks for the points.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.