[PHP-DB] Re: [PHP] Passing vars

2001-02-15 Thread Andrew Hill

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" [EMAIL PROTECTED] 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:[EMAIL PROTECTED]]
 Sent: Thursday, February 15, 2001 3:20 AM
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 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
 


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] RE: [PHP] Passing vars

2001-02-15 Thread Maxim Maletsky

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:[EMAIL PROTECTED]]
Sent: Thursday, February 15, 2001 3:20 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
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


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]