Solved

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

Posted on 2011-02-16
4
262 Views
Last Modified: 2012-05-11
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
Comment
Question by:sydneyguy
  • 2
4 Comments
 
LVL 24

Accepted Solution

by:
mankowitz earned 250 total points
Comment Utility
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
 

Assisted Solution

by:PeggyOCO
PeggyOCO earned 250 total points
Comment Utility
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
 

Author Comment

by:sydneyguy
Comment Utility
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
 

Author Closing Comment

by:sydneyguy
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now