Re: Passing vars

From: Date: Fri, 16 Feb 2001 04:00:11 +0000
Subject: Re: Passing vars
References: 1  Groups: php.db php.general 
Request: Send a blank email to php-general+get-40094@lists.php.net to get a copy of this message
You may wish to consider why you need to pass 30 lines of code in a variable. If the code is static, store it in include files and then pass it in depending one a variable if ($variable=1) { include(your30linefile); } else { inclue(someotherfile); } or to use a database query, pass a select value in as the index: $sql = "select some_field from table where id_field = $variable either way, you pass the value of $variable in from a page with this kind of link: <a href="page_name.php?variable=1">click me to submit $varible=1 to page_name.php</a> If the 30 lines of code is html that needs to be generated on the fly, break it up into common blocks and drop them in using either method above. You can also do things like passing a hidden form field instead of using a link. Best regards, Andrew --------------------------------------- Andrew Hill - OpenLink Software Director Technology Evangelism eBusiness Infrastructure Technology http://www.openlinksw.com On 2/15/01 10:20 PM, "Maxim Maletsky" <maxim.maletsky@japaninc.net> wrote: > you can use sessions .. > > php.net/sessions > > the session are cookies which will remember the user and will copy what you > need on your system, making these 30 lines available only to him for the > time you specify. > > Cheers, > Maxim Maletsky > > -----Original Message----- > From: Tanya Brethour [mailto:brethour@ncsa.uiuc.edu] > Sent: Thursday, February 15, 2001 3:20 AM > To: php-general@lists.php.net > Cc: php-db@lists.php.net > Subject: [PHP] Passing vars > > > > Quick question.. > > If I have like 6 variables to pass to another PHP script... and some of > the vars are actually multiple lines of text (lets say over 30 lines). > What is the best way of doing this? > > I would like to avoid doing something like test.php?cheese=(30 lines of > stuff) > > Thanks in advance! > -Tanya >

« previous php.general (#40094) next »