Php – How to access the variable values from URL in smarty template

if statementPHPquery-stringsmarty

I'm using PHP and smarty for my website. I'm getting a URL in address bar and I want to use the values from URL into smaarty template. So is it possible to do that? If yes can you explain? For your understanding I'm giving you the URL as follows:

http://localhost/eprime/entprm/web/control/modules/enquiries/manage_contact_us.php?contact_id=56&contact_full_name=ZainabJuzerBhavnagarwala&contact_email_id=fatemabhav21@gmail.com&op=view&reply_to_enquiry_suc=1&from_date=11/09/2000&to_date=11/09/2013

Suppose from the above URL I want to access the values of variables contact_full_name and contact_email_id in my smarty template which is currently being displaed. Can you explain me how could I achieve this?

Actually I tried the following code but it didn't output anything.

<input type="text" name="contact_full_name" id="contact_full_name" value="{ if $data.contact_full_name!=''} {$data.contact_full_name|capitalize} {else} {$contact_full_name|capitalize} {/if}" class="">

Thanks in advance.

Best Answer

Look at smarty reserved variables :

{$smarty.get.contact_email_id}