Solved

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

Posted on 2011-02-16
4
306 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Suggested Solutions

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
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…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

710 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