Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Printing out an element in an array - Problem

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 11-13-2003, 03:26 PM
 
machnhed1 machnhed1 is offline
 

eXpert
  
Join Date: Feb 2003
Location: Illinois
Posts: 274
 

Default Printing out an element in an array - Problem

Ok, I've done this a thousand times before, but tonight I must not be firing on all cylinders because, I can't figure out why this isn't working:

Doing a print_r of an $HTTP_POST_VARS variable generates the following array:
Code:
Array ( [test1] => 50 [test2] => 98746 [x] => 37 [y] => 5 )

I then assigned it to smarty with the following code:
Code:
$smarty->assign("fm_subs","$HTTP_POST_VARS");

I then tried to print the element "test1" in my smarty template with the following code:
Code:
{$fm_subs.test1}

It's printing out an "A", so I assume it is trying to tell me that I am referencing the entire array, but for the life of me, I don't know what I am doing wrong.

To anyone who answers this, thank you
__________________
Following the signature guidelines : xcart pro 3.5.8 - [RedHat]
Reply With Quote
  #2  
Old 11-13-2003, 11:07 PM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

should it be:

$smarty->assign("fm_subs",$HTTP_POST_VARS);

?
__________________
ex x-cart guru
Reply With Quote
  #3  
Old 11-14-2003, 05:05 AM
 
machnhed1 machnhed1 is offline
 

eXpert
  
Join Date: Feb 2003
Location: Illinois
Posts: 274
 

Default

FD,

Worked like a charm.

Thanks again for the save. Ever have those days when the answer was right under your nose, but you just didn't look to see it?

__________________
Following the signature guidelines : xcart pro 3.5.8 - [RedHat]
Reply With Quote
  #4  
Old 11-14-2003, 07:06 AM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

every day
__________________
ex x-cart guru
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 01:55 AM.

   

 
X-Cart forums © 2001-2020