Re: [SMARTY] new php

From: Date: Thu, 13 Jun 2002 03:07:14 +0000
Subject: Re: [SMARTY] new php
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-4827@lists.php.net to get a copy of this message
These values are always located in the superglobal array $_GET do a var_dump($_GET) to see what I mean. Your script will work if you explicitly assign all of the values you know are coming in, i.e. $id = $_GET['id']; or with less errors: $id = (array_key_exists('id', $_GET)) ? $_GET['id'] : ''; or for a complete hack with equal security problems to register_globals on, see http://www.php.net/manual/en/function.import-request-variables.php ----- Original Message ----- From: "Blue Presley" <blue928@carolina.rr.com> To: <smarty-general@lists.php.net> Sent: Wednesday, June 12, 2002 9:56 PM Subject: [SMARTY] new php i'll apologize in advance for this being a bit off topic, but i've tried to incorporate a bit of smarty into it so as to not totally be off base.... okay.. in the past i've enjoyed being able to pass variables as name/value pairs in the URL. this was essential for getting appropriate data from my SQL database. here is an example of the code. getDetails.php?id=1 and of course, this would get data associated with that particular table entry. anyway, as of version 4.1.0, I register_globals has been turned off and it's strongly suggested that it not be turned on for security reasons.. okay, fine, but now i can't pass name/value pairs in the url. so part of my question is, I have to be able to reference the IDs for an entry. If i can't use name value pairs, then how do I do it? now here is where smarty comes in. I'm thinking that i can create a multidimensional array out of $_GLOBALS[] and assign the id to each one. then i could have something like getDetails.php?id=<?php echo $_globals[id][x]; ?>.. but how do i assign that to a Smarty variable to use in the template? all thoughts appreciated.. thanks! :) blue

« previous php.smarty.general (#4827) next »