[PHP] passing vars

2004-02-24 Thread Rick Liwczak
need some help.  Quite obviously I am new so bare with meI am trying to
pass a value (ENGLISH OR FRENCH) when the user clicks on either one of two
images.  If image 1, the value is english, if image 2 the value is french.
Once they click the image which I use the following code (and it is probably
wacked) to call the assign( ) function, it should update the
$SESSION['Language'] variable but it does notYour help is really
appreciated  Rick

**
pstrongWould you like to proceed in English or French?/strong/p
  pstronga href=?php $_SERVER['PHP_SELF'] ? img
src=images/english.gif width=193 height=35 border=0 onClick=?php
assign(English); ? /a/strong/p
  pstronga href=?php $_SERVER['PHP_SELF'] ? img
src=images/french.gif width=193 height=35 border=0 onClick=?php
assign(French); ? /a/strong/p
*
HERE IS AM CHECKING JUST TO SEE WHAT THE SESSION_LANGUAGE IS HOLDING...IT IS
ALWAYS FRENCH?

?php
  print(pthe value is  . $_SESSION['Language'] .  /p\n);
   ?





?php

session_start();

 if(isset($_SESSION['Count'])) // are we established?
 {
  if(isset($_SESSION['Language']))
  {
  //header(Location: http://www.blah blah blah);
  }
  else
  {
  }
 }
 else
 {
  $_SESSION['Count']=1;

 }
 function assign($choice)
 {
  switch($choice)
  {
  case English:
  $_SESSION['Language']= English;

  case French:
  $_SESSION['Language']= French;
  }
 }
?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Passing vars w/refresh w/register globals off?

2003-11-25 Thread Kim Steinhaug
Well first off all it is possible to post and get at the same time.
Dont know why you want to, but its kinda easy really :

Example :

form name=myform action=myscript.php?get1=aget2=b method=post
input type=hidden name=jalla value=balla
/form

You can submit this form several ways, with ordinary submit button, or with
javascrip submit.

If you really want to keep serving variables that shouldnt be visble in the
browser or in the html kode I guess the only way would be using cookies.
But if the variables are defined by the users input / behavior there is
surely
the need of showing the variables one place or another.

You mentioned that there were up to a 100 variables to be passed here.
Was that pr user or in total? Sending like a 100 variables with GET would
be a bad idea all together, since there are limits on how many caracters the
URL can hold. Some years ago alot of browsers had a limit on 128 characters,
this is imporved by the years but still the only way to feed long sets of
data
is through post.

If all your variables can be stored on the server, assigning a unique ID to
the
session would make you able to store everything in the database as someone
mentioned earlier. This wasy all you need is pass the ID within the browser.
By checking the ID against the unique session on the server you will also
eliminate tampering with the data. Webpages that has like a 100 hidden
fields
doesnt look very professional, but hey - it works.

The other thing is that forms can also talk with eachother nicely, what I
mean
is that you can share the informastion with the help of javascript. Storing
all
the information you need for later in a form somewhere in the html page,
then
when you build the refresh url you just pick out the data you want to use
from the different form elements (document.form.variable.value).

I still havnt quite understood what you are accually asking for here, but
hey,
it seems like you dont know yourself, hehe

-- 
Kim Steinhaug
---
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
---


Floyd Baker [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 On Fri, 18 Jan 2002 18:13:50 +0800, you wrote:

 On Friday 18 January 2002 04:11, Floyd Baker wrote:
 
  Yes.  I was using the url to pass variables without a form.
 
  It looks like the javascript idea would cover that now that you remind
  me.  I've used it before to refresh two frames at once.
 
  But even so I'd rather not go that way if at all possible.  I'd like
  to stay within php's ability.
 
 Not being able to POST and GET is a 'limitation' of HTTP not PHP.
 
  Not knowing what I'm talking about for sure but is there no way of
  putting a variable into the 'post' status or condition, prior to being
  redirected, without actually using a form?
 
 Only be using a form will you be able to POST.
 
  Thanks for the idea though.  It'll work if nothing else. :-)
 
 
 Up to now we (I?) still don't know exactly what you're trying to do.
Maybe if
 you could tell us what you're doing and if appropriate post some code,
then
 we could see if there is another solution to your problem.
 
 
 -- 
 Jason Wong - Gremlins Associates - www.gremlins.com.hk
 
 /*
 I am just a nice, clean-cut Mongolian boy.
  -- Yul Brynner, 1956
 */

 This should be fairly standard.  Filling out a form and using a
 recursive call and if/then, to bring the variables around to a case
 switch for routing to desired pages according to form input data.

 if 'completed = y
 (

 switch
   case
 get to go here
   case
 get go there

 )
 else
 (
 post to /this page
 form
 submit
 )


 This draft does work but I don't like the visible url variables.

 Of course in addition we have all the fields passed by the form post
 that were used as required on switch case and receiving pages...  Now
 we need to REQUEST every one.  That's fine for the sake of the
 security but now it's beneficial to get into arrays, etc. to keep
 script shorter and easier to maintain.  More learning. Always good.
 4.1 is pushing me.  :-)

 The solutions look more involved than my poor coding has been til now.
 We need to put more things into function form maybe, instead of
 passing between separate pages.

 I'm probably still out in left field with a lot of this *visualizing*
 but it's coming.  And always good to talk it out.

 Can you tell me if it's possible to run 4.03 and 4.1 *both* on the
 same machine?  I'm thinking the old script would be php3 and the new
 stuff php4.  Is that something that could be done until the old
 scripts are upgraded?

 Floyd



 --


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Passing $Vars between 2 php pages

2003-07-16 Thread Valentin
Hi,
is any way to pass a $Var from one to other php pages without using FORM
and Cookies?

Thanks,




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Passing $Vars between 2 php pages

2003-07-16 Thread Robert Cummings
Use the GET method (URL parameters). If you want to pass (foo=5) then
do the following:

a href=www.mySite.org?foo=5 A link label /a

Cheers,
Rob.

On Wed, 2003-07-16 at 12:44, Valentin wrote:
 Hi,
 is any way to pass a $Var from one to other php pages without using FORM
 and Cookies?
 
 Thanks,
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Passing $Vars between 2 php pages

2003-07-16 Thread John Manko
page1.php
$_SESSION['myvars_VARNAME'] =  $varname;
the 'myvars_' is just for identification purposes, so avoid over-writing 
anthing that you might not want to.

page2.php
$varname =  $_SESSION['myvars_VARNAME'];
Valentin wrote:

Hi,
is any way to pass a $Var from one to other php pages without using FORM
and Cookies?
Thanks,



 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Passing $Vars between 2 php pages

2003-07-16 Thread Valentin
Thank you Robert!
But, I forgot to mention... and without URI



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Passing $Vars between 2 php pages

2003-07-16 Thread Valentin
Thanks John!




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Passing $Vars between 2 php pages

2003-07-16 Thread Jeff Harris
|Valentin wrote:
|
|Hi, is any way to pass a $Var from one to other php pages without using
|DEFANGED_FORM and Cookies?
|
|Thanks,
|
On Jul 16, 2003, John Manko claimed that:

|page1.php
|$_SESSION['myvars_VARNAME'] =  $varname;
|the 'myvars_' is just for identification purposes, so avoid over-writing
|anthing that you might not want to.
|
|page2.php
|$varname =  $_SESSION['myvars_VARNAME'];

Session still either use cookies or URI:
There are two methods to propagate a session id: Cookies, URL parameter

Thus sayeth the oracle:
http://www.php.net/manual/en/ref.session.php

The only way that I can see of passing a variable from page to page
without using cookies or URI would be to make sure that only one person
can access the entire site at one time and use either a database or a file
on the server.

Jeff
-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Passing $Vars between 2 php pages

2003-07-16 Thread John Manko
why not build a GET QUERY_STRING, save it in a database along with the 
session_id, the read it on the second page, parsing the string.

Jeff Harris wrote:

|Valentin wrote:
|
|Hi, is any way to pass a $Var from one to other php pages without using
|DEFANGED_FORM and Cookies?
|
|Thanks,
|
On Jul 16, 2003, John Manko claimed that:
|page1.php
|$_SESSION['myvars_VARNAME'] =  $varname;
|the 'myvars_' is just for identification purposes, so avoid over-writing
|anthing that you might not want to.
|
|page2.php
|$varname =  $_SESSION['myvars_VARNAME'];
Session still either use cookies or URI:
There are two methods to propagate a session id: Cookies, URL parameter
Thus sayeth the oracle:
http://www.php.net/manual/en/ref.session.php
The only way that I can see of passing a variable from page to page
without using cookies or URI would be to make sure that only one person
can access the entire site at one time and use either a database or a file
on the server.
Jeff
 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] passing vars. betn. php and javascript

2002-04-26 Thread Pushkar Pradhan

I need to pass an array from php to javascript,
change the ordering of the elements in javasc..
pass this reordered array back to php script?
Is it possible to do this and if so can anyone send me the basic code,
I've never written javascript? Thanks,

-Pushkar S. Pradhan


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] passing vars. betn. php and javascript

2002-04-26 Thread Jason Wong

On Saturday 27 April 2002 00:56, Pushkar Pradhan wrote:
 I need to pass an array from php to javascript,
 change the ordering of the elements in javasc..
 pass this reordered array back to php script?
 Is it possible to do this and if so can anyone send me the basic code,
 I've never written javascript? Thanks,

How is the array reordered?

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Maturity is only a short break in adolescence.
-- Jules Feiffer
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] passing vars. betn. php and javascript

2002-04-26 Thread Pushkar Pradhan

In my php I had 4 buttons, up, down, top and bottom:
After detecting which element and which button was clicked I changed the
element position by
using array_slice, shift, unshift, array_merge etc..
I'm not sure what I'll do it JS
 On Saturday 27 April 2002 00:56, Pushkar Pradhan wrote:
  I need to pass an array from php to javascript,
  change the ordering of the elements in javasc..
  pass this reordered array back to php script?
  Is it possible to do this and if so can anyone send me the basic code,
  I've never written javascript? Thanks,

 How is the array reordered?

 --
 Jason Wong - Gremlins Associates - www.gremlins.com.hk
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *

 /*
 Maturity is only a short break in adolescence.
   -- Jules Feiffer
 */

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


-Pushkar S. Pradhan


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] passing vars. betn. php and javascript

2002-04-26 Thread Jason Wong

On Saturday 27 April 2002 01:23, Pushkar Pradhan wrote:
 In my php I had 4 buttons, up, down, top and bottom:
 After detecting which element and which button was clicked I changed the
 element position by
 using array_slice, shift, unshift, array_merge etc..
 I'm not sure what I'll do it JS

Well, depending on how you were reordering the array I was going to suggest 
you use php. Since you already have a version in php and you want to do it in 
javascript then ...

   I've never written javascript? Thanks,

I suggest you learn some javascript then think about how to pass an array 
to it from php :)

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
The profession of book writing makes horse racing seem like a solid,
stable business.
-- John Steinbeck
[Horse racing *is* a stable business ...]
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] passing vars. betn. php and javascript

2002-04-26 Thread Leotta, Natalie (NCI/IMS)

Is there any reason that you have to use JS to redo the array?  I did
something like this once and had the buttons monitored by JS, then when you
click it set a hidden var (with a name like sort) and submitted the page.
Then my PHP read in everything and redrew the graph based on what we were
sorting by.  It wasn't as difficult as it sounds - the only problem was they
decided that it wasn't pertinent to that graph, so we aren't using it
anymore.  I don't know if I have any of the code left.

-Natalie

-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]] 
Sent: Friday, April 26, 2002 1:46 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] passing vars. betn. php and javascript


On Saturday 27 April 2002 01:23, Pushkar Pradhan wrote:
 In my php I had 4 buttons, up, down, top and bottom:
 After detecting which element and which button was clicked I changed 
 the element position by using array_slice, shift, unshift, array_merge 
 etc.. I'm not sure what I'll do it JS

Well, depending on how you were reordering the array I was going to suggest 
you use php. Since you already have a version in php and you want to do it
in 
javascript then ...

   I've never written javascript? Thanks,

I suggest you learn some javascript then think about how to pass an array 
to it from php :)

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
The profession of book writing makes horse racing seem like a solid, stable
business.
-- John Steinbeck
[Horse racing *is* a stable business ...]
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] passing vars. betn. php and javascript

2002-04-26 Thread Kevin Stone

This sounds susspiciously like a Javascript question to me.  :)

I wrote a PHP/Javascript system a while back that prints out an event
calendar on a client page.  The Javascript is copypaste so you can have the
calendar show up on any web page anywhere in the world.  It works like
this..

The Javascript on the client's page redirects to the PHP script on my server
with display_dates and clientid in the URL string.  Then the PHP script
parses $_GET and extracts the requested data from the database.  Then the
PHP script does a redirect back to the originating Javascript (known by
$HTTP_REFERER) with the compressed data (again in the URL string).  The
Javascript does some simple parsing and generates the calendar table based
on the extracted values.

This sounds a lot like what you want to do.  But how you parse the data in
Javascript is obviously not a PHP question.  Are you're certain this
reordering isn't something that can be done in PHP?  I guess my real
question is what is the Javascript for?

-Kevin

- Original Message -
From: Pushkar Pradhan [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, April 26, 2002 11:23 AM
Subject: Re: [PHP] passing vars. betn. php and javascript


 In my php I had 4 buttons, up, down, top and bottom:
 After detecting which element and which button was clicked I changed the
 element position by
 using array_slice, shift, unshift, array_merge etc..
 I'm not sure what I'll do it JS

  On Saturday 27 April 2002 00:56, Pushkar Pradhan wrote:
   I need to pass an array from php to javascript,
   change the ordering of the elements in javasc..
   pass this reordered array back to php script?
   Is it possible to do this and if so can anyone send me the basic code,
   I've never written javascript? Thanks,
 
  How is the array reordered?
 
  --
  Jason Wong - Gremlins Associates - www.gremlins.com.hk
  Open Source Software Systems Integrators
  * Web Design  Hosting * Internet  Intranet Applications Development *
 
  /*
  Maturity is only a short break in adolescence.
  -- Jules Feiffer
  */
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 

 -Pushkar S. Pradhan


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] passing vars. betn. php and javascript

2002-04-26 Thread Pushkar Pradhan

Actually I was frustrated trying to redirect to a new page and not being
able to pass the array along to the new page usign header(), I won't get
the array in my new page. Also I thought JS would be faster since the
client can submit after doing as many reorderings as he/she wants.

 Is there any reason that you have to use JS to redo the array?  I did
 something like this once and had the buttons monitored by JS, then when you
 click it set a hidden var (with a name like sort) and submitted the page.
 Then my PHP read in everything and redrew the graph based on what we were
 sorting by.  It wasn't as difficult as it sounds - the only problem was they
 decided that it wasn't pertinent to that graph, so we aren't using it
 anymore.  I don't know if I have any of the code left.

 -Natalie

 -Original Message-
 From: Jason Wong [mailto:[EMAIL PROTECTED]]
 Sent: Friday, April 26, 2002 1:46 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] passing vars. betn. php and javascript


 On Saturday 27 April 2002 01:23, Pushkar Pradhan wrote:
  In my php I had 4 buttons, up, down, top and bottom:
  After detecting which element and which button was clicked I changed
  the element position by using array_slice, shift, unshift, array_merge
  etc.. I'm not sure what I'll do it JS

 Well, depending on how you were reordering the array I was going to suggest
 you use php. Since you already have a version in php and you want to do it
 in
 javascript then ...

I've never written javascript? Thanks,

 I suggest you learn some javascript then think about how to pass an array
 to it from php :)

 --
 Jason Wong - Gremlins Associates - www.gremlins.com.hk
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *

 /*
 The profession of book writing makes horse racing seem like a solid, stable
 business.
   -- John Steinbeck
   [Horse racing *is* a stable business ...]
 */

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


-Pushkar S. Pradhan


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] passing vars. betn. php and javascript

2002-04-26 Thread Pushkar Pradhan

Believe me I certainly don't want to ask a JS ques. here, I am reading
tutorials on the web!
I already accomplished reordering using PHP, I gave up on php since I
wasn't able to pass arrays betn. pages using header().
In PHP when user moves each element and submits up, down, top or bottom
there is server-client communication while in JS there will be
server-client comm. only at the end when a Done button is pressed.
i.e. SPEED :-)

 This sounds susspiciously like a Javascript question to me.  :)

 I wrote a PHP/Javascript system a while back that prints out an event
 calendar on a client page.  The Javascript is copypaste so you can have the
 calendar show up on any web page anywhere in the world.  It works like
 this..

 The Javascript on the client's page redirects to the PHP script on my server
 with display_dates and clientid in the URL string.  Then the PHP script
 parses $_GET and extracts the requested data from the database.  Then the
 PHP script does a redirect back to the originating Javascript (known by
 $HTTP_REFERER) with the compressed data (again in the URL string).  The
 Javascript does some simple parsing and generates the calendar table based
 on the extracted values.

 This sounds a lot like what you want to do.  But how you parse the data in
 Javascript is obviously not a PHP question.  Are you're certain this
 reordering isn't something that can be done in PHP?  I guess my real
 question is what is the Javascript for?

 -Kevin

 - Original Message -
 From: Pushkar Pradhan [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Friday, April 26, 2002 11:23 AM
 Subject: Re: [PHP] passing vars. betn. php and javascript


  In my php I had 4 buttons, up, down, top and bottom:
  After detecting which element and which button was clicked I changed the
  element position by
  using array_slice, shift, unshift, array_merge etc..
  I'm not sure what I'll do it JS

   On Saturday 27 April 2002 00:56, Pushkar Pradhan wrote:
I need to pass an array from php to javascript,
change the ordering of the elements in javasc..
pass this reordered array back to php script?
Is it possible to do this and if so can anyone send me the basic code,
I've never written javascript? Thanks,
  
   How is the array reordered?
  
   --
   Jason Wong - Gremlins Associates - www.gremlins.com.hk
   Open Source Software Systems Integrators
   * Web Design  Hosting * Internet  Intranet Applications Development *
  
   /*
   Maturity is only a short break in adolescence.
   -- Jules Feiffer
   */
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
 
  -Pushkar S. Pradhan
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 



-Pushkar S. Pradhan


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] passing vars. betn. php and javascript

2002-04-26 Thread Kevin Stone

Okay I'm beginning to understand.  I don't think you have to use Javascript
in this situation you jsut have to be a little clever about how you build
your URL string.  You can send an array through the URL by splitting up each
value like this..

$url = 'http://www.domain.com/index.php?myarray[]='.$myarray[0];
for ($i=1; $icount($myarray); $i++)
{
$url  .= 'myarray[]='.$myarray[$i];
}
header(Location: $url);

You will get $_GET[myarray] on the other side.  OR you can do a single comma
or semicolon delimited string and then explode(',' $myarray) on the other
end to reconstitue the array.  Hope that helps.

-Kevin

- Original Message -
From: Pushkar Pradhan [EMAIL PROTECTED]
To: Leotta, Natalie (NCI/IMS) [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, April 26, 2002 12:10 PM
Subject: RE: [PHP] passing vars. betn. php and javascript


 Actually I was frustrated trying to redirect to a new page and not being
 able to pass the array along to the new page usign header(), I won't get
 the array in my new page. Also I thought JS would be faster since the
 client can submit after doing as many reorderings as he/she wants.

  Is there any reason that you have to use JS to redo the array?  I did
  something like this once and had the buttons monitored by JS, then when
you
  click it set a hidden var (with a name like sort) and submitted the
page.
  Then my PHP read in everything and redrew the graph based on what we
were
  sorting by.  It wasn't as difficult as it sounds - the only problem was
they
  decided that it wasn't pertinent to that graph, so we aren't using it
  anymore.  I don't know if I have any of the code left.
 
  -Natalie
 
  -Original Message-
  From: Jason Wong [mailto:[EMAIL PROTECTED]]
  Sent: Friday, April 26, 2002 1:46 PM
  To: [EMAIL PROTECTED]
  Subject: Re: [PHP] passing vars. betn. php and javascript
 
 
  On Saturday 27 April 2002 01:23, Pushkar Pradhan wrote:
   In my php I had 4 buttons, up, down, top and bottom:
   After detecting which element and which button was clicked I changed
   the element position by using array_slice, shift, unshift, array_merge
   etc.. I'm not sure what I'll do it JS
 
  Well, depending on how you were reordering the array I was going to
suggest
  you use php. Since you already have a version in php and you want to do
it
  in
  javascript then ...
 
 I've never written javascript? Thanks,
 
  I suggest you learn some javascript then think about how to pass an
array
  to it from php :)
 
  --
  Jason Wong - Gremlins Associates - www.gremlins.com.hk
  Open Source Software Systems Integrators
  * Web Design  Hosting * Internet  Intranet Applications Development *
 
  /*
  The profession of book writing makes horse racing seem like a solid,
stable
  business.
  -- John Steinbeck
  [Horse racing *is* a stable business ...]
  */
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 

 -Pushkar S. Pradhan


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] passing vars. betn. php and javascript

2002-04-26 Thread Erik Price


On Friday, April 26, 2002, at 02:15  PM, Pushkar Pradhan wrote:

 Believe me I certainly don't want to ask a JS ques. here, I am reading
 tutorials on the web!
 I already accomplished reordering using PHP, I gave up on php since I
 wasn't able to pass arrays betn. pages using header().

If your arrays are not huge, why can you not simply use the GET method?

$array = array('mutant', 'zombie', 'psychic');
$temp_array = array();
foreach ($array as $freak) {
   $temparray[] = 'freaks[]=' . $freak;
}
$headerstring = implode('', $temparray);

header('Location: http://www.domain.com/page.php?' . $headerstring);


The above code creates a querystring that should look like

freaks[]=mutantfreaks[]=zombiefreaks[]=psychic

Then, in your receiving PHP page, just do something like

foreach ($_GET['freaks'] as $freak) {
print $freak;
}

Or whatever processing you need to do.


Erik





Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] passing vars. betn. php and javascript

2002-04-26 Thread Pushkar Pradhan

Great! It works fine. Thanks to Kevin, Erik, Miguel and all others who
responded to this query since yesterday.
I have $QUERY_STRING in my php 4.0.6.



On Fri, 26 Apr 2002, Kevin Stone wrote:

 Okay I'm beginning to understand.  I don't think you have to use Javascript
 in this situation you jsut have to be a little clever about how you build
 your URL string.  You can send an array through the URL by splitting up each
 value like this..

 $url = 'http://www.domain.com/index.php?myarray[]='.$myarray[0];
 for ($i=1; $icount($myarray); $i++)
 {
 $url  .= 'myarray[]='.$myarray[$i];
 }
 header(Location: $url);

 You will get $_GET[myarray] on the other side.  OR you can do a single comma
 or semicolon delimited string and then explode(',' $myarray) on the other
 end to reconstitue the array.  Hope that helps.

 -Kevin

 - Original Message -
 From: Pushkar Pradhan [EMAIL PROTECTED]
 To: Leotta, Natalie (NCI/IMS) [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Friday, April 26, 2002 12:10 PM
 Subject: RE: [PHP] passing vars. betn. php and javascript


  Actually I was frustrated trying to redirect to a new page and not being
  able to pass the array along to the new page usign header(), I won't get
  the array in my new page. Also I thought JS would be faster since the
  client can submit after doing as many reorderings as he/she wants.
 
   Is there any reason that you have to use JS to redo the array?  I did
   something like this once and had the buttons monitored by JS, then when
 you
   click it set a hidden var (with a name like sort) and submitted the
 page.
   Then my PHP read in everything and redrew the graph based on what we
 were
   sorting by.  It wasn't as difficult as it sounds - the only problem was
 they
   decided that it wasn't pertinent to that graph, so we aren't using it
   anymore.  I don't know if I have any of the code left.
  
   -Natalie
  
   -Original Message-
   From: Jason Wong [mailto:[EMAIL PROTECTED]]
   Sent: Friday, April 26, 2002 1:46 PM
   To: [EMAIL PROTECTED]
   Subject: Re: [PHP] passing vars. betn. php and javascript
  
  
   On Saturday 27 April 2002 01:23, Pushkar Pradhan wrote:
In my php I had 4 buttons, up, down, top and bottom:
After detecting which element and which button was clicked I changed
the element position by using array_slice, shift, unshift, array_merge
etc.. I'm not sure what I'll do it JS
  
   Well, depending on how you were reordering the array I was going to
 suggest
   you use php. Since you already have a version in php and you want to do
 it
   in
   javascript then ...
  
  I've never written javascript? Thanks,
  
   I suggest you learn some javascript then think about how to pass an
 array
   to it from php :)
  
   --
   Jason Wong - Gremlins Associates - www.gremlins.com.hk
   Open Source Software Systems Integrators
   * Web Design  Hosting * Internet  Intranet Applications Development *
  
   /*
   The profession of book writing makes horse racing seem like a solid,
 stable
   business.
   -- John Steinbeck
   [Horse racing *is* a stable business ...]
   */
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
 
  -Pushkar S. Pradhan
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


-Pushkar S. Pradhan


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Passing vars w/refresh w/register globals off?

2002-01-18 Thread Jason Wong

On Friday 18 January 2002 04:11, Floyd Baker wrote:

 Yes.  I was using the url to pass variables without a form.

 It looks like the javascript idea would cover that now that you remind
 me.  I've used it before to refresh two frames at once.

 But even so I'd rather not go that way if at all possible.  I'd like
 to stay within php's ability.

Not being able to POST and GET is a 'limitation' of HTTP not PHP.

 Not knowing what I'm talking about for sure but is there no way of
 putting a variable into the 'post' status or condition, prior to being
 redirected, without actually using a form?

Only be using a form will you be able to POST.

 Thanks for the idea though.  It'll work if nothing else. :-)


Up to now we (I?) still don't know exactly what you're trying to do. Maybe if 
you could tell us what you're doing and if appropriate post some code, then 
we could see if there is another solution to your problem.


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
I am just a nice, clean-cut Mongolian boy.
-- Yul Brynner, 1956
*/

-- 
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]




Re: [PHP] Passing vars w/refresh w/register globals off?

2002-01-18 Thread Floyd Baker

On Fri, 18 Jan 2002 18:13:50 +0800, you wrote:

On Friday 18 January 2002 04:11, Floyd Baker wrote:

 Yes.  I was using the url to pass variables without a form.

 It looks like the javascript idea would cover that now that you remind
 me.  I've used it before to refresh two frames at once.

 But even so I'd rather not go that way if at all possible.  I'd like
 to stay within php's ability.

Not being able to POST and GET is a 'limitation' of HTTP not PHP.

 Not knowing what I'm talking about for sure but is there no way of
 putting a variable into the 'post' status or condition, prior to being
 redirected, without actually using a form?

Only be using a form will you be able to POST.

 Thanks for the idea though.  It'll work if nothing else. :-)


Up to now we (I?) still don't know exactly what you're trying to do. Maybe if 
you could tell us what you're doing and if appropriate post some code, then 
we could see if there is another solution to your problem.


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
I am just a nice, clean-cut Mongolian boy.
   -- Yul Brynner, 1956
*/

This should be fairly standard.  Filling out a form and using a
recursive call and if/then, to bring the variables around to a case
switch for routing to desired pages according to form input data.

if 'completed = y 
(

switch 
  case 
get to go here
  case 
get go there

)
else
(
post to /this page 
form
submit
)


This draft does work but I don't like the visible url variables.  

Of course in addition we have all the fields passed by the form post
that were used as required on switch case and receiving pages...  Now
we need to REQUEST every one.  That's fine for the sake of the
security but now it's beneficial to get into arrays, etc. to keep
script shorter and easier to maintain.  More learning. Always good.
4.1 is pushing me.  :-)  

The solutions look more involved than my poor coding has been til now.
We need to put more things into function form maybe, instead of
passing between separate pages.  

I'm probably still out in left field with a lot of this *visualizing*
but it's coming.  And always good to talk it out.  

Can you tell me if it's possible to run 4.03 and 4.1 *both* on the
same machine?  I'm thinking the old script would be php3 and the new
stuff php4.  Is that something that could be done until the old
scripts are upgraded?  

Floyd 



--


-- 
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]




Re: [PHP] Passing vars w/refresh w/register globals off?

2002-01-17 Thread Floyd Baker

On Thu, 17 Jan 2002 07:06:50 +0200, you wrote:

What do you mean by 'hidden'? If you're talking about a hidden form input,
how can it not be post?

Bogdan


Just saying I've tried it.  Figured it wouldn't work but wasn't sure
how 'refresh' might relate to 'post'.  Post passing works fine with
$_request on the other end but I've got a lot of this refresh kind of
passing that doesn't work, and not sure how best to fix it.  

I don't want to rewrite the entire method to not include refresh.  :-

Floyd




Floyd Baker wrote:

 Hi..

 Got 4.1.1 going and think it's going to work fine.  Except for this.

 A form calls itself and then uses the menu selection to route through
 a switch to various refresh redirects...

 'Hidden' isn't working and it's not post, get, cookie, etc.  Can it be
 done?

 TIA

 Floyd

 --

 --
 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 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]




Re: [PHP] Passing vars w/refresh w/register globals off?

2002-01-17 Thread Jason Wong

On Friday 18 January 2002 00:41, Floyd Baker wrote:
 On Thu, 17 Jan 2002 07:06:50 +0200, you wrote:
 What do you mean by 'hidden'? If you're talking about a hidden form input,
 how can it not be post?
 
 Bogdan

 Just saying I've tried it.  Figured it wouldn't work but wasn't sure
 how 'refresh' might relate to 'post'.  Post passing works fine with
 $_request on the other end but I've got a lot of this refresh kind of
 passing that doesn't work, and not sure how best to fix it.

 I don't want to rewrite the entire method to not include refresh.  :-

If they are refresh redirects as in using the META tags then you're not going 
to get any form (POST) data. Perhaps you can elaborate on what you're trying 
to do. And if appropriate, post some code.


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
Sorry, no fortune this time.
*/

-- 
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]




Re: [PHP] Passing vars w/refresh w/register globals off?

2002-01-17 Thread Floyd Baker

On Fri, 18 Jan 2002 01:03:19 +0800, you wrote:

On Friday 18 January 2002 00:41, Floyd Baker wrote:
 On Thu, 17 Jan 2002 07:06:50 +0200, you wrote:
 What do you mean by 'hidden'? If you're talking about a hidden form input,
 how can it not be post?
 
 Bogdan

 Just saying I've tried it.  Figured it wouldn't work but wasn't sure
 how 'refresh' might relate to 'post'.  Post passing works fine with
 $_request on the other end but I've got a lot of this refresh kind of
 passing that doesn't work, and not sure how best to fix it.

 I don't want to rewrite the entire method to not include refresh.  :-

If they are refresh redirects as in using the META tags then you're not going 
to get any form (POST) data. Perhaps you can elaborate on what you're trying 
to do. And if appropriate, post some code.


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
Sorry, no fortune this time.
*/


Jason.  

The thing is, I *was* using GET in the refresh line and I guess I
wasn't saying that.  Moreover I want to pass passwords in the same
transfer but obviously letting them show up in the url is not cool...

My question should be more like, how can one pass variables in a way
that doesn't use a form but is still secure? 


And thanks too for asking.  I hope everyone understands that even
questions make it easier for a person to focus their thoughts.  I hate
to ask dumb questions, or put things the wrong way, but the problem is
I don't know they're dumb at first.  One little question I didn't
think to ask myself can make it all come clear.   

Floyd

--


-- 
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]




RE: [PHP] Passing vars w/refresh w/register globals off?

2002-01-17 Thread scott [gts]

 
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

you could save the password to a database, associated with
an ID number, then pass the ID number.

DATABASE:
- 
id| password
12345 | blah$$

URL:
form.php?id=12345

- 
Scott Hurring - Internet Programmer
GraphicType Services
tel: 973.667.9486
web: http://www.graphictype.com/ 
pgp: http://graphictype.com/scott/pgp.txt
- 


 -Original Message-
 From: Floyd Baker [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, January 17, 2002 1:36 PM
 To: Jason Wong
 Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: Re: [PHP] Passing vars w/refresh w/register globals off?
 
 
 On Fri, 18 Jan 2002 01:03:19 +0800, you wrote:
 
 On Friday 18 January 2002 00:41, Floyd Baker wrote:
  On Thu, 17 Jan 2002 07:06:50 +0200, you wrote:
  What do you mean by 'hidden'? If you're talking about a hidden form
  input, how can it not be post?
  
  Bogdan
 
  Just saying I've tried it.  Figured it wouldn't work but wasn't sure
  how 'refresh' might relate to 'post'.  Post passing works fine with
  $_request on the other end but I've got a lot of this refresh kind of
  passing that doesn't work, and not sure how best to fix it.
 
  I don't want to rewrite the entire method to not include refresh.  :-
 
 If they are refresh redirects as in using the META tags then you're not
 going  to get any form (POST) data. Perhaps you can elaborate on what you're
 trying  to do. And if appropriate, post some code.
 
 
 -- 
 Jason Wong - Gremlins Associates - www.gremlins.com.hk
 
 /*
 Sorry, no fortune this time.
 */
 
 
 Jason.  
 
 The thing is, I *was* using GET in the refresh line and I guess I
 wasn't saying that.  Moreover I want to pass passwords in the same
 transfer but obviously letting them show up in the url is not cool...
 
 My question should be more like, how can one pass variables in a way
 that doesn't use a form but is still secure? 
 
 
 And thanks too for asking.  I hope everyone understands that even
 questions make it easier for a person to focus their thoughts.  I hate
 to ask dumb questions, or put things the wrong way, but the problem is
 I don't know they're dumb at first.  One little question I didn't
 think to ask myself can make it all come clear.   
 
 Floyd
 
 --
 
 
 -- 
 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]
 

-BEGIN PGP SIGNATURE-
Version: PGPfreeware 7.0.3 for non-commercial use http://www.pgp.com

iQA/AwUBPEccKsaXTGgZdrSUEQIFuwCfZOI5Ct1iozF86nS3/MziIRo6UlMAoIUb
qZV9tkmSWBOXkiqBkE5TwfFe
=qb1c
-END PGP SIGNATURE-



-- 
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]




Re: [PHP] Passing vars w/refresh w/register globals off?

2002-01-17 Thread Jason Wong

On Friday 18 January 2002 02:36, Floyd Baker wrote:

 The thing is, I *was* using GET in the refresh line and I guess I
 wasn't saying that.  Moreover I want to pass passwords in the same
 transfer but obviously letting them show up in the url is not cool...

If I understand you correctly you're trying to pass variables via the url 
(GET), and at the same via a form (POST)? If so, then I'm afraid that's 
impossible.

 My question should be more like, how can one pass variables in a way
 that doesn't use a form but is still secure?

I'm presuming that you don't want to use a form because you need the META tag 
refresh thing. If by 'secure' you mean that it's not visible on the url then 
you *could* use a form. Just use a bit of Javascript to automatically submit 
the form.


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
The clothes have no emperor.
-- C.A.R. Hoare, commenting on ADA.
*/

-- 
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]




Re: [PHP] Passing vars w/refresh w/register globals off?

2002-01-17 Thread Floyd Baker

On Fri, 18 Jan 2002 03:39:21 +0800, you wrote:

On Friday 18 January 2002 02:36, Floyd Baker wrote:

 The thing is, I *was* using GET in the refresh line and I guess I
 wasn't saying that.  Moreover I want to pass passwords in the same
 transfer but obviously letting them show up in the url is not cool...

If I understand you correctly you're trying to pass variables via the url 
(GET), and at the same via a form (POST)? If so, then I'm afraid that's 
impossible.

 My question should be more like, how can one pass variables in a way
 that doesn't use a form but is still secure?

I'm presuming that you don't want to use a form because you need the META tag 
refresh thing. If by 'secure' you mean that it's not visible on the url then 
you *could* use a form. Just use a bit of Javascript to automatically submit 
the form.


Yes.  I was using the url to pass variables without a form.  

It looks like the javascript idea would cover that now that you remind
me.  I've used it before to refresh two frames at once.  

But even so I'd rather not go that way if at all possible.  I'd like
to stay within php's ability.   

Not knowing what I'm talking about for sure but is there no way of
putting a variable into the 'post' status or condition, prior to being
redirected, without actually using a form?  

Thanks for the idea though.  It'll work if nothing else. :-)

Floyd




-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
The clothes have no emperor.
   -- C.A.R. Hoare, commenting on ADA.
*/

--


-- 
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]




Re: [PHP] Passing vars w/refresh w/register globals off?

2002-01-17 Thread Floyd Baker

On Thu, 17 Jan 2002 13:47:06 -0500, you wrote:

 
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

you could save the password to a database, associated with
an ID number, then pass the ID number.

DATABASE:
- 
id| password
12345 | blah$$

URL:
form.php?id=12345


I've done something like that in another situation.  Wrote to a flat
file and then read from it in the action page.  

If it was just a few variables maybe, but I have cases where 100 need
to be passed.  It looks like a lot of rewriting is coming...  Even
with post passing, they all have to be collected them at the other end
in some minimal script manner.   Am I right in thinking arrays in this
case?  

Thanks.

Floyd



--


-- 
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] Passing vars w/refresh w/register globals off?

2002-01-16 Thread Floyd Baker



Hi..  

Got 4.1.1 going and think it's going to work fine.  Except for this.

A form calls itself and then uses the menu selection to route through
a switch to various refresh redirects...

'Hidden' isn't working and it's not post, get, cookie, etc.  Can it be
done?  

TIA

Floyd


--


-- 
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]




Re: [PHP] Passing vars w/refresh w/register globals off?

2002-01-16 Thread Bogdan Stancescu

What do you mean by 'hidden'? If you're talking about a hidden form input,
how can it not be post?

Bogdan

Floyd Baker wrote:

 Hi..

 Got 4.1.1 going and think it's going to work fine.  Except for this.

 A form calls itself and then uses the menu selection to route through
 a switch to various refresh redirects...

 'Hidden' isn't working and it's not post, get, cookie, etc.  Can it be
 done?

 TIA

 Floyd

 --

 --
 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 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] Passing vars...

2001-11-10 Thread Ashley M. Kirchner


Small problem...  I used to have a single file that included others
based on some variables set.  However, I've decided instead of including
a different file, I would set a location header and redirect the browser
to the (once included) file instead.  Problem is, now my variables
aren't being passed from one page to the other now.

My index.php file sets the following in a form:

// variables passed
// $email[to]   - who the mail is send to
// $email[from] - from who the mail came it
// $name[to]- the name of the person who will get the mail
// $name[from]  - the name of the person who send the mail
// $picture - the full picture-url
// $comment - comment
// $session[ID] - a simple sessionID
// $album   - album in catalog
// $startitem   - page (item) in album

...and I need those variables passed on to the file to which I'm
redirecting to.  Any ideas anyone?

--
H | Life is the art of drawing without an eraser. - John Gardner
  +
  Ashley M. Kirchner mailto:[EMAIL PROTECTED]   .   303.442.6410 x130
  Director of Internet Operations / SysAdmin. 800.441.3873 x130
  Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave, #6
  http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A.



-- 
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]




Re: [PHP] Passing vars between functions (with POSTs)

2001-05-16 Thread Rasmus Lerdorf

 I've tried other ways but my problem still continues... I can not pass
 $login var out of the function.

 I don't have this problem in the two previous functions because I pass this
 variable as function argument, but this last function that doesn't have
 arguments I can't see the $login (even if is setup on the previous function
 as global). I don't know why I PHP doesn't allow to setup a $login as global
 to all functions (this will solve this problem).

It does.  You simply have to declare in the function you wish to access
the global variable that you want the global variable by using the global
keyword in that function.

Please read the Variables Scope chapter in the manual:

http://php.net/manual/en/language.variables.scope.php

-Rasmus


-- 
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]




Re: [PHP] Passing vars between functions (with POSTs)

2001-05-16 Thread Miguel Ribeiro

Thanks for your reply but for example, my problem is more like the following
php3:

?
$login='';

Function login() {
 global $login;
 echo('form enctype=multipart/form-data method=post
action=test.php3?s=1');
 echo(' pLogin/pinput type=text name=login size=10');
 echo('input type=submit value=Submit name=B1');
 echo('/form');
}

function vrf_passwd($f1) {
 printf(Login=%s,$f1);
}

switch($s) {
 case 1:  vrf_passwd($login);
   break;
 default: login();
   break;
}
?





Rasmus Lerdorf [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  I've tried other ways but my problem still continues... I can not pass
  $login var out of the function.
 
  I don't have this problem in the two previous functions because I pass
this
  variable as function argument, but this last function that doesn't have
  arguments I can't see the $login (even if is setup on the previous
function
  as global). I don't know why I PHP doesn't allow to setup a $login as
global
  to all functions (this will solve this problem).

 It does.  You simply have to declare in the function you wish to access
 the global variable that you want the global variable by using the global
 keyword in that function.

 Please read the Variables Scope chapter in the manual:

 http://php.net/manual/en/language.variables.scope.php

 -Rasmus


 --
 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 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]




Re: [PHP] Passing vars between functions (with POSTs)

2001-05-15 Thread Chris Lee

this will ensure that the variable is a POST var vs a GET var too...

function test()
{
global $HTTP_POST_VARS;

echo $HTTP_POST_VARS['login'];
}

-- 

 Chris Lee
 [EMAIL PROTECTED]


Miguel Ribeiro [EMAIL PROTECTED] wrote in message 
9dpgkk$mdb$[EMAIL PROTECTED]">news:9dpgkk$mdb$[EMAIL PROTECTED]...
Hi,

I'm struggling to pass from 3 functions (and one of them have a html form
POST) one simple variable called $login.

Once in the function (that have form with POST) is calling a php3 without
passing the $login (like: common.php3login='someone') and since the next
function doesn't have any relation with this one (doesn't receive any value
by return) but requires the same variable ($login).

My question and great doubt is:

How can I share $login in several functions... without use or change
(because I don't have access) the PHP configuration environment...

I believe that this could be solve with register_globals var but I don't
know how to do it.

Best Regards,
Miguel



-- 
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 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] Passing vars between functions (with POSTs)

2001-05-14 Thread Miguel Ribeiro

Hi,

I'm struggling to pass from 3 functions (and one of them have a html form
POST) one simple variable called $login.

Once in the function (that have form with POST) is calling a php3 without
passing the $login (like: common.php3login='someone') and since the next
function doesn't have any relation with this one (doesn't receive any value
by return) but requires the same variable ($login).

My question and great doubt is:

How can I share $login in several functions... without use or change
(because I don't have access) the PHP configuration environment...

I believe that this could be solve with register_globals var but I don't
know how to do it.

Best Regards,
Miguel



-- 
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]




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 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]




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 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] Passing vars

2001-02-14 Thread Tanya Brethour


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]




Re: [PHP] Passing vars

2001-02-14 Thread Ankur Verma

one way would be to pass this using Hidden fields if you can submit the form

or else use the session variables to propogate the values across multiple
pages

http://www.php.net/manual/en/ref.session.php

or try out phplib if you are on PHP3

hope that helps

best regards

Ankur Verma
HCL Technologies
A1CD, Sec -16
Noida, UP
India

- Original Message -
From: "Tanya Brethour" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Wednesday, February 14, 2001 11:50 PM
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 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]