| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Passing Smarty variable to PHP | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() When the registration form is submitted (or anywhere on or before the final checkout page) the page needs to execute a php script that will pass the currently set Smarty variables $search.engine and $search.phrase to php variables $search.engine and $search.phrase. Once those two variables are set in PHP, I've got the rest.
Two Questions, How do I execute a PHP script from within Smarty? How do I pass a variable from Smarty to PHP? Any help on this would be appreciated!
__________________
Jeremy Freeman EZWatch Store X-Cart v4.1.5 |
|||||||
#2
|
|||||||||
|
|||||||||
![]() Code:
As for getting Smarty object variables you can easily see they are accessible with following template code: Code:
![]() ..And if your not doing the php inside of a .tpl, simply use $Smarty instead of $this. |
|||||||||
#3
|
|||||||
|
|||||||
![]() Thank you for your previous answer, I have one more question..
I have found the values I need in PHP.. how do I reference them? Ive come up with: Code:
I need to be able to call extra.. How do I go about this in PHP? Ive tried $_userinfo[extra] but that doesnt seem to do anything..
__________________
Jeremy Freeman EZWatch Store X-Cart v4.1.5 |
|||||||
#5
|
|||||||
|
|||||||
![]() That sure makes a lot more sense, but unfortunately it doesn't do anything still.. My code is
Code:
__________________
Jeremy Freeman EZWatch Store X-Cart v4.1.5 |
|||||||
#6
|
|||||||
|
|||||||
![]() Nevermind, I changed $Smarty to $this (im in {php}).. Thanks a ton!
__________________
Jeremy Freeman EZWatch Store X-Cart v4.1.5 |
|||||||
|
|||
X-Cart forums © 2001-2020
|