Solved

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

Posted on 2011-02-16
4
275 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
ID: 34913422
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
ID: 34913438
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
ID: 34913465
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
ID: 35044776
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

910 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

16 Experts available now in Live!

Get 1:1 Help Now