Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 322
  • Last Modified:

were does {$sectionid} value come from in a tpl file runing of php

have a tpl file which is called from a php page, then the tpl page os loaded which hss the below code on it.
but there is no $sectionid varable available in the php list, there is in the _GET but its not access ing this data. its got to come from some were. if i run an alert before hand t retuens a varable but when i loook through the var list its just not there any ideas on how this sectionid={$sectionid} opertes and were it woudl be defined

<script type="text/javascript">
      alert({$sectionid}+" sectionquestionsdetails"+" itemid "+{$item.id});
</script>
<td><a href='sectionquestiondetailLv2.php?sectionid={$sectionid}&amp;questionid={$item.id}'>
{$item.answer|stripslashes}</a></td>      
0
sydneyguy
Asked:
sydneyguy
  • 2
2 Solutions
 
mankowitzCommented:
if $sectionid is not declared anywhere, (check all the smarty templates and all the included and required php files) and the only time it is used is part of a GET parameter, the only way you'd have it available in your script is if register_globals is set (which it shouldn't be).

See http://www.php.net/manual/en/ini.core.php#ini.register-globals
0
 
PeggyOCOCommented:
Can you post the part of the PHP script where you are defining variables?  Did you write the PHP script, or is this PHP a part of a program written by others that you are using?  If your Smarty template is using a variable named sectionid, that variable would be defined in the PHP program.  By "php list" do you mean the list of variables defined in the php program?
0
 
sydneyguyAuthor Commented:
its out of osdate so written by others,
By "php list" do you mean the list of variables defined in the php program?  i reliase it may be a global but i cannot see it any were in the varables list, i am running it under eclippse so can see all the associated varables but cannot see the varable that its showing so i must not be looking in the right place

check all the smarty templates and all the included and required php files) will do a search for it and see were it comes up
0
 
sydneyguyAuthor Commented:
thanks for the help article was good and informative, am now pushing the code through good learning curve though. thanks for both of your imput, they both helped in puch my code through
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now