Solved

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

Posted on 2011-02-16
4
302 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
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.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will learn how to count occurrences of each item in an array.

679 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