[PHP] $HTTP_POST_VARS

2004-10-07 Thread Pahlevanzadeh Mohsen
Dears,I need to my program is waitting while
$HTTP_POST_VARS change
Please guide me..

=
-DIGITAL  SIGNATURE---
///Mohsen Pahlevanzadeh
 Network administrator   programmer 
  My home phone is: +98213810146  
My email address is  
  m_pahlevanzadeh at yahoo dot com   
My website is: http://webnegar.net




___
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

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



[PHP] $HTTP_POST_VARS

2003-06-09 Thread Awlad Hussain
Whats the advantage (or shall i say disadvantage )of passing form variables to a 
function like shown below:

function function_name($var,$var1,$var2)
{

}

rather than passing the $HTTP_POST_VARS array to the fuction like:

function function_name($HTTP_POST_VARS)
{

}

Is any better than other? or both the same?

awlad

Re: [PHP] $HTTP_POST_VARS

2003-06-09 Thread Àíòîí
Hi


AH Whats the advantage (or shall i say disadvantage )of passing form variables to a 
function like shown below:

AH function function_name($var,$var1,$var2)
AH {

AH }

AH rather than passing the $HTTP_POST_VARS array to the fuction like:

AH function function_name($HTTP_POST_VARS)
AH {

AH }

AH Is any better than other? or both the same?

AH awlad


Use $_POST and pass nothing to the function. It is superglobal array.


-- 
Regards

Anton


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



[PHP] HTTP_POST_VARS empty!

2003-03-12 Thread Vincent M.
Hello,

I don't understand this code empty my HTTP_POST_VARS variable:
if ((get_magic_quotes_gpc() == 1)) {
  switch ($REQUEST_METHOD) {
  case POST:
while (list ($key, $val) = each ($HTTP_POST_VARS)) {
  $$key = stripslashes($val);
}
break;
  case GET:
while (list ($key, $val) = each ($HTTP_GET_VARS)) {
  $$key = stripslashes($val);
}
break;
  }
}
This script is usefull to simulate get_magic_quotes_gpc to 0 but if I do 
 it it empty my HTTP_POST_VARS and this code does not work:
while(list ($key, $val) = each($HTTP_POST_VARS)) {
  echo $key = $valbr;
}
echo Here we are...!!!... ;

It displays, Here we are...!!!... but nothing at all for $key and for $val

How should I do to simulate get_magic_quotes_gpc to 0 without emptying 
HTTP_POST_VARS ?

Thanks,
Vincent.
PS: If I delete the code ...(get_magic_quotes_gpc() == 1)...it works...

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


[PHP] $HTTP_POST_VARS problem

2002-12-16 Thread Lee P. Reilly
Hi there,

I'm currently using PHP 4.2.2 and I am have encountered some problems
when trying to access $HTTP_POST_VARS. The following statements have the
following return values:

echo $HTTP_POST_VARS['userfile'];
= C:\\Documents and Settings\\Administrator\\Desktop\\IR Files\\gmp1.ir

echo $userfile;
= C:\\Documents and Settings\\Administrator\\Desktop\\IR Files\\gmp1.ir

echo $HTTP_POST_VARS['userfile']['name'];
= NOTHING RETURNED

echo $HTTP_POST_VARS['userfile']['size'];
= NOTHING RETURNED

echo $userfile_size;
= NOTHING RETURNED

echo $userfile_name;
= NOTHING RETURNED

Does anyone know what the problem is? I suspect that the '\\' in the
path may have something to do with it.

Thanks,
Lee


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




Re: [PHP] $HTTP_POST_VARS problem

2002-12-16 Thread Jason Wong
On Monday 16 December 2002 23:48, Lee P. Reilly wrote:
 Hi there,

 I'm currently using PHP 4.2.2 and I am have encountered some problems
 when trying to access $HTTP_POST_VARS. The following statements have the
 following return values:

 echo $HTTP_POST_VARS['userfile'];
 = C:\\Documents and Settings\\Administrator\\Desktop\\IR Files\\gmp1.ir

Better to use $_POST.

 echo $userfile;
 = C:\\Documents and Settings\\Administrator\\Desktop\\IR Files\\gmp1.ir

 echo $HTTP_POST_VARS['userfile']['name'];
 = NOTHING RETURNED

Use $_FILES.

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

/*
In a gathering of two or more people, when a lighted cigarette is
placed in an ashtray, the smoke will waft into the face of the non-smoker.
*/


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




Re: [PHP] $HTTP_POST_VARS problem

2002-12-16 Thread rblack

Think you want $HTTP_POST_FILES rather than $HTTP_POST_VARS.

As in $HTTP_POST_FILES['userfile']['name'];

HTH,

Richy

==
Richard Black
Senior Developer, DataVisibility Ltd - http://www.datavisibility.com
Tel: 0141 951 3481
Email: [EMAIL PROTECTED]


   

Lee P.

Reilly  To: PHP [EMAIL PROTECTED]   

lreilly@lanl.   cc:   

gov Subject: [PHP] $HTTP_POST_VARS problem

   

16/12/2002 

15:48  

   

   





Hi there,

I'm currently using PHP 4.2.2 and I am have encountered some problems
when trying to access $HTTP_POST_VARS. The following statements have the
following return values:

echo $HTTP_POST_VARS['userfile'];
= C:\\Documents and Settings\\Administrator\\Desktop\\IR Files\\gmp1.ir

echo $userfile;
= C:\\Documents and Settings\\Administrator\\Desktop\\IR Files\\gmp1.ir

echo $HTTP_POST_VARS['userfile']['name'];
= NOTHING RETURNED

echo $HTTP_POST_VARS['userfile']['size'];
= NOTHING RETURNED

echo $userfile_size;
= NOTHING RETURNED

echo $userfile_name;
= NOTHING RETURNED

Does anyone know what the problem is? I suspect that the '\\' in the
path may have something to do with it.

Thanks,
Lee


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



This email has been scanned for all viruses by the MessageLabs SkyScan
service. For more information on a proactive anti-virus service working
around the clock, around the globe, visit http://www.messagelabs.com






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




Re: [PHP] $HTTP_POST_VARS problem

2002-12-16 Thread Chris Shiflett
--- Lee P. Reilly [EMAIL PROTECTED] wrote:
 The following statements have the following return
 values:
 
 echo $HTTP_POST_VARS['userfile'];
 = C:\\Documents and Settings\\Administrator\\Desktop\\IR
 Files\\gmp1.ir
 
 echo $userfile;
 = C:\\Documents and Settings\\Administrator\\Desktop\\IR
 Files\\gmp1.ir
 
 echo $HTTP_POST_VARS['userfile']['name'];
 = NOTHING RETURNED
 
 echo $HTTP_POST_VARS['userfile']['size'];
 = NOTHING RETURNED
 
 echo $userfile_size;
 = NOTHING RETURNED
 
 echo $userfile_name;
 = NOTHING RETURNED
 
 Does anyone know what the problem is?

What do you think the problem is? I don't see anything
unexpected, unless I'm missing something.

Chris

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




Re: [PHP] $HTTP_POST_VARS problem

2002-12-16 Thread Lee P. Reilly
Thanks for all the replies. However, I still have problems as the following code
produces the following output:

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
echo 0:  . $userfile . br;
echo 1:  . $HTTP_POST_FILES['userfile']['size'] . br;
echo 2:  . $HTTP_POST_FILES['userfile']['name'] . br;
echo 3:  . $HTTP_POST_FILES['userfile']['type'] . br;
echo 4:  . $HTTP_POST_FILES .  ( . sizeof($HTTP_POST_FILES) . )br;
echo 5:  . $HTTP_POST_FILES['userfile_size'] . br;
echo 6:  . $HTTP_POST_FILES['userfile']['type'] . br;
echo 7:  . $HTTP_POST_FILES['userfile_type'] . br;
echo 8:  . $usefile_type . br;

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
0: C:\\Documents and Settings\\Administrator\\Desktop\\IR Files\\gmp05.iR
1:
2:
3:
4: Array (0)
5:
6:
7:
8:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=



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




Re: [PHP] $HTTP_POST_VARS problem

2002-12-16 Thread Joseph W. Goff
It looks to me like you are trying to get an uploaded file?
If so, it isn't $HTTP_POST_VARS, it is $HTTP_POST_FILES or $_FILES if you
are using a version of PHP that has super globals.
See the PHP manual for more info:
http://www.php.net/manual/en/language.variables.predefined.php

- Original Message -
From: Chris Shiflett [EMAIL PROTECTED]
To: Lee P. Reilly [EMAIL PROTECTED]; PHP [EMAIL PROTECTED]
Sent: Monday, December 16, 2002 10:04 AM
Subject: Re: [PHP] $HTTP_POST_VARS problem


 --- Lee P. Reilly [EMAIL PROTECTED] wrote:
  The following statements have the following return
  values:
 
  echo $HTTP_POST_VARS['userfile'];
  = C:\\Documents and Settings\\Administrator\\Desktop\\IR
  Files\\gmp1.ir
 
  echo $userfile;
  = C:\\Documents and Settings\\Administrator\\Desktop\\IR
  Files\\gmp1.ir
 
  echo $HTTP_POST_VARS['userfile']['name'];
  = NOTHING RETURNED
 
  echo $HTTP_POST_VARS['userfile']['size'];
  = NOTHING RETURNED
 
  echo $userfile_size;
  = NOTHING RETURNED
 
  echo $userfile_name;
  = NOTHING RETURNED
 
  Does anyone know what the problem is?

 What do you think the problem is? I don't see anything
 unexpected, unless I'm missing something.

 Chris

 --
 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] $HTTP_POST_VARS problem

2002-12-16 Thread Lee P. Reilly
Problem solved:
I forgot to add the enctype to the original FORM tag.

Cheers,
Lee,


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




[PHP] HTTP_POST_VARS Question

2002-06-20 Thread Chris Sechiatano

Hi,

Just a simple question about the HTTP_POST_VARS.  I know my forms will work
if I use only the name of the input.  Say a text box called FirstName.  I
can just do:

print $FirstName;

and everything works fine.  Why would I want to use

print $HTTP_POST_VARS[FirstName];

instead?


Thanks

-- 
Chris Sechiatano
[EMAIL PROTECTED]
www.chris-s.com

PGP Key 0x0021EFA0




msg67494/pgp0.pgp
Description: PGP signature


Re: [PHP] HTTP_POST_VARS Question

2002-06-20 Thread Erik Price


On Thursday, June 20, 2002, at 02:41  PM, Chris Sechiatano wrote:

 Just a simple question about the HTTP_POST_VARS.  I know my forms will
 work
 if I use only the name of the input.  Say a text box called FirstName.
 I
 can just do:

 print $FirstName;

 and everything works fine.  Why would I want to use

 print $HTTP_POST_VARS[FirstName];

 instead?

Read the warning box at this page: 
http://www.php.net/manual/en/language.variables.predefined.php

The short version: in PHP 4.1.2 or later you need to either use $_POST, 
$_GET, etc unless you set register_global = on (it is off by default).

You don't really ever want to use $HTTP_POST_VARS, $HTTP_GET_VARS, etc 
unless you are using a version of PHP from before PHP 4.1.0.  In which 
case you might want to use it in combination with turning 
register_globals = off, to help yourself avoid making bad coding 
mistakes.

It's no substitute for good coding, but it can help.


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




[PHP] $HTTP_POST_VARS vs _POST

2002-04-22 Thread DrouetL

HI ML

Only one little question :
I know that _POST doesn't exists on php 4.0.6 but does $HTTP_POST_VARS
exist on php 4.1.2 ?


Regards

Laurent



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




Re: [PHP] $HTTP_POST_VARS vs _POST

2002-04-22 Thread Erik Price


On Monday, April 22, 2002, at 12:19  PM, [EMAIL PROTECTED] wrote:

 HI ML

 Only one little question :
 I know that _POST doesn't exists on php 4.0.6 but does $HTTP_POST_VARS
 exist on php 4.1.2 ?

Yes, but you would have had an answer to this question 45 minutes ago if 
you had just tried it.


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




[PHP] $HTTP_POST_VARS

2002-03-21 Thread Joshua E Minnie

I need to access a variable on a form that allows multiples.  I have to use
$HTTP_POST_VARS so I need to know how to display the information obtained
from the form.  This is what I am using right now:

?
  reset($HTTP_POST_VARS[interest]);
  while(current($HTTP_POST_VARS[interest])) {
echo strip_tags(trim($HTTP_POST_VARS[interest])).nbsp;nbsp;nbsp;;
next($HTTP_POST_VARS[interest]));
  }
?

Both $HTTP_POST_VARS[interest] and $HTTP_POST_VARS[interest[]] throw
errors.  Any suggestions would be greatly appreciated.


--
Joshua E Minnie
CIO
[EMAIL PROTECTED]

Don't work for recognition, but always do work worthy of recognition.



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




RE: [PHP] $HTTP_POST_VARS

2002-03-21 Thread Rick Emery

$interest = $HTTP_POST_VARS['interest'];

or (if using PHP 4.1)
$interest = $_POST['interest'];

then reference $interest[0], $interest[1], $interest[2],...


-Original Message-
From: Joshua E Minnie [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 21, 2002 11:54 AM
To: [EMAIL PROTECTED]
Subject: [PHP] $HTTP_POST_VARS


I need to access a variable on a form that allows multiples.  I have to use
$HTTP_POST_VARS so I need to know how to display the information obtained
from the form.  This is what I am using right now:

?
  reset($HTTP_POST_VARS[interest]);
  while(current($HTTP_POST_VARS[interest])) {
echo strip_tags(trim($HTTP_POST_VARS[interest])).nbsp;nbsp;nbsp;;
next($HTTP_POST_VARS[interest]));
  }
?

Both $HTTP_POST_VARS[interest] and $HTTP_POST_VARS[interest[]] throw
errors.  Any suggestions would be greatly appreciated.


--
Joshua E Minnie
CIO
[EMAIL PROTECTED]

Don't work for recognition, but always do work worthy of recognition.



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

2002-03-21 Thread Miguel Cruz

On Thu, 21 Mar 2002, Joshua E Minnie wrote:
 I need to access a variable on a form that allows multiples.  I have to use
 $HTTP_POST_VARS so I need to know how to display the information obtained
 from the form.  This is what I am using right now:
 
 ?
   reset($HTTP_POST_VARS[interest]);
   while(current($HTTP_POST_VARS[interest])) {
 echo strip_tags(trim($HTTP_POST_VARS[interest])).nbsp;nbsp;nbsp;;
 next($HTTP_POST_VARS[interest]));
   }
 ?
 
 Both $HTTP_POST_VARS[interest] and $HTTP_POST_VARS[interest[]] throw
 errors.  Any suggestions would be greatly appreciated.

1. Make sure you defined the form element in your HTML as interest[] and
not interest.

2. Test to see that it's an array before trying to run loop through it,
because if the user doesn't select anything, you won't get an array, and
therefore referring to to the variable as one would be an error.

if (is_array($HTTP_POST_VARS['interest']))
  foreach ($HTTP_POST_VARS['interest'] as $item)
echo strip_tags(trim($item)) . 'nbsp;nbsp;nbsp;';

miguel


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




RE: [PHP] HTTP_POST_VARS problem

2002-02-08 Thread Tim Ward

Make the name of the select an array
e.g. select name='selection[]' ...

then ...
foreach($HTTP_POST_VARS[selection] as $selection)

Tim
www.chessish.com http://www.chessish.com 

--
From:  [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]]
Sent:  08 February 2002 02:47
To:  [EMAIL PROTECTED]
Subject:  Re: [PHP] HTTP_POST_VARS problem

Please ignore my question - I just figured it out. I had the
method=post
in the input type=submit tag rather than in the form tag. It
works!

However, if one has an HTML select/option menu scrolling list with
multiple
selections, how does one get the number of values for the same name
with
HTTP_POST_VARS? Or how does one scroll through the list of choices
passed?
Thanks,

Eurico

[EMAIL PROTECTED] wrote:

 Hi. I'm a newbie at this and am having problems understanding how
this
 works.

 I have a form with method=post. The server program does display
 REQUEST_STRING as I expect (e.g., choice=yes but displaying
 HTTP_POST_VARS[choice] is null). However, displaying
 HTTP_GET_VARS[choice] does display yes. Running phpinfo()
displays
 that the REQUEST_METHOD = GET. Why is this GET and how do I get it
set
 to POST? How do I get HTTP_POST_VARS to work since my form does
have
 method=post?

 Here are some php.ini settings (I'm running PHP 4.1.1 with Apache
1.3.22

 under Win98):

 variables_order = EGPCS
 register_globals = On
 register_argc_argv = On
 gpc_order = GPC

 Thanks...

 Eurico
 [EMAIL PROTECTED]

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




[PHP] HTTP_POST_VARS problem

2002-02-07 Thread ejfs

Hi. I'm a newbie at this and am having problems understanding how this
works.

I have a form with method=post. The server program does display
REQUEST_STRING as I expect (e.g., choice=yes but displaying
HTTP_POST_VARS[choice] is null). However, displaying
HTTP_GET_VARS[choice] does display yes. Running phpinfo() displays
that the REQUEST_METHOD = GET. Why is this GET and how do I get it set
to POST? How do I get HTTP_POST_VARS to work since my form does have
method=post?

Here are some php.ini settings (I'm running PHP 4.1.1 with Apache 1.3.22

under Win98):

variables_order = EGPCS
register_globals = On
register_argc_argv = On
gpc_order = GPC

Thanks...

Eurico
[EMAIL PROTECTED]


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




Re: [PHP] HTTP_POST_VARS problem

2002-02-07 Thread ejfs

Please ignore my question - I just figured it out. I had the method=post
in the input type=submit tag rather than in the form tag. It works!

However, if one has an HTML select/option menu scrolling list with multiple
selections, how does one get the number of values for the same name with
HTTP_POST_VARS? Or how does one scroll through the list of choices passed?
Thanks,

Eurico

[EMAIL PROTECTED] wrote:

 Hi. I'm a newbie at this and am having problems understanding how this
 works.

 I have a form with method=post. The server program does display
 REQUEST_STRING as I expect (e.g., choice=yes but displaying
 HTTP_POST_VARS[choice] is null). However, displaying
 HTTP_GET_VARS[choice] does display yes. Running phpinfo() displays
 that the REQUEST_METHOD = GET. Why is this GET and how do I get it set
 to POST? How do I get HTTP_POST_VARS to work since my form does have
 method=post?

 Here are some php.ini settings (I'm running PHP 4.1.1 with Apache 1.3.22

 under Win98):

 variables_order = EGPCS
 register_globals = On
 register_argc_argv = On
 gpc_order = GPC

 Thanks...

 Eurico
 [EMAIL PROTECTED]

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




[PHP] HTTP_POST_VARS and passing by reference

2002-01-17 Thread Bryan McCloskey

Hello,

I'm attempting to make a function to which I can pass
my form variables, to wit:

clean_input($HTTP_POST_VARS);

which will run through the array and clean up the
variables. However, the passing by reference is giving
me the screaming fits. No matter what I do, I can't
seem to get the function to alter the actual array,
and not a copy of it. I tried it with arraywalk(), but
that produces a copy of the array, so I'm trying
each() and list() like this:

function clean_input($form_vars)
{
   reset($form_vars);
   while ($element = each($form_vars))
   {
  trim(strip_tags(stripslashes($element[1])));
   }
}

but this just makes another copy. HTTP_POST_VARS still
contains the ugly, raw input. Putting an  in front
of $element in the while loop caused the script to
crash. I know there should probably be another 
somewhere, but I can't figure out where. Any help
would be appreciated!

-bryan

=
---
Schrodinger may have slept here.
---

__
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

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

2001-11-30 Thread mweb

Hello,

To test the http/php setup on one of my computers I wrote a
very simple html form, with two select fields,
two text fields, and the submit field. Pushing submit the
data are sent via POST method to an extremely simple PHP
page which only contains something like:

foreach (var, key) in HTTP_POST_VARS {

print VAR: $var KEY = $key
}

It works, (meaning that php code is correct, html output is displayed,
and no error are reported) but only prints three lines, i.e. the two select fields are 
missing.
Both the php and the html code are syntactically correct: I
double checked that on the books, just to be sure.

It looks like the select fields, and them only, are not passed
to the form by the server, or that in some other way they never
make it into HTTP_POST_VARS.

Any ideas? Setup is plain Red Hat 7.2 with its default apache/php
packages.

TIA,
mweb


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

2001-11-30 Thread Andrey Hristov

I cannot compile this:
try that :
foreach ($HTTP_POST_VARS as $key = $var){
print VAR: $var KEY = $key;
}

Regards,
Andrey Hristov
- Original Message - 
From: mweb [EMAIL PROTECTED]
To: phplist [EMAIL PROTECTED]
Sent: Friday, November 30, 2001 10:03 AM
Subject: [PHP] HTTP_POST_VARS truncated


Hello,

To test the http/php setup on one of my computers I wrote a
very simple html form, with two select fields,
two text fields, and the submit field. Pushing submit the
data are sent via POST method to an extremely simple PHP 
page which only contains something like:

foreach (var, key) in HTTP_POST_VARS {

print VAR: $var KEY = $key
}

It works, (meaning that php code is correct, html output is displayed,
and no error are reported) but only prints three lines, i.e. the two select fields are 
missing.
Both the php and the html code are syntactically correct: I
double checked that on the books, just to be sure.

It looks like the select fields, and them only, are not passed
to the form by the server, or that in some other way they never
make it into HTTP_POST_VARS.

Any ideas? Setup is plain Red Hat 7.2 with its default apache/php
packages.

TIA,
mweb


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

2001-11-30 Thread Jason

try:
reset($HTTP_POST_VARS);

at the begining of the code. if that doesn't work verify your html again.
make sure the select's are between the form tag. php doesn't ignore
certain form fields. =)

i'm the habit of reading arrays like...
while(list($k,$v) = each($HTTP_POST_VARS)) {
echo key is $k - val is $v \n;
}


 To test the http/php setup on one of my computers I wrote a
 very simple html form, with two select fields,
 two text fields, and the submit field. Pushing submit the
 data are sent via POST method to an extremely simple PHP
 page which only contains something like:

 foreach (var, key) in HTTP_POST_VARS {

 print VAR: $var KEY = $key
 }

 It works, (meaning that php code is correct, html output is displayed,
 and no error are reported) but only prints three lines, i.e. the two
select fields are missing.
 Both the php and the html code are syntactically correct: I
 double checked that on the books, just to be sure.

 It looks like the select fields, and them only, are not passed
 to the form by the server, or that in some other way they never
 make it into HTTP_POST_VARS.

 Any ideas? Setup is plain Red Hat 7.2 with its default apache/php
 packages.

 TIA,
 mweb


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

2001-11-30 Thread De Necker Henri

Thanks Jason  Jani!Both ur ways work!

$loc = ..\files\poese.txt
$loc = ..\\files\\poese.txt

But another question that comes to mind is that why must i include the '..\'
to move down to a sub-directory?
I thought '..\' moves up a directory tree!

This also works both ways :

$loc = ../files/poese.txt
$loc = ..//files//poese.txt


-Original Message-
From: Jason [mailto:[EMAIL PROTECTED]]
Sent: 30 November 2001 10:54
To: mweb; phplist
Subject: Re: [PHP] HTTP_POST_VARS truncated


try:
reset($HTTP_POST_VARS);

at the begining of the code. if that doesn't work verify your html again.
make sure the select's are between the form tag. php doesn't ignore
certain form fields. =)

i'm the habit of reading arrays like...
while(list($k,$v) = each($HTTP_POST_VARS)) {
echo key is $k - val is $v \n;
}


 To test the http/php setup on one of my computers I wrote a
 very simple html form, with two select fields,
 two text fields, and the submit field. Pushing submit the
 data are sent via POST method to an extremely simple PHP
 page which only contains something like:

 foreach (var, key) in HTTP_POST_VARS {

 print VAR: $var KEY = $key
 }

 It works, (meaning that php code is correct, html output is displayed,
 and no error are reported) but only prints three lines, i.e. the two
select fields are missing.
 Both the php and the html code are syntactically correct: I
 double checked that on the books, just to be sure.

 It looks like the select fields, and them only, are not passed
 to the form by the server, or that in some other way they never
 make it into HTTP_POST_VARS.

 Any ideas? Setup is plain Red Hat 7.2 with its default apache/php
 packages.

 TIA,
 mweb


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

2001-11-30 Thread mweb


 reset($HTTP_POST_VARS);

 at the begining of the code. if that doesn't work verify your html again.
 make sure the select's are between the form tag. php doesn't ignore
 certain form fields. =)

 i'm the habit of reading arrays like...
 while(list($k,$v) = each($HTTP_POST_VARS)) {
 echo key is $k - val is $v \n;

Thanks Jason
I'll try it tonight, I'm not at my desk now.

However, I would like to highlight that:

1) the select tags *are* inside the forms ones. I know php accepts all
 form fields, that's why I'm so puzzled...
2) I know that the code I posted here is wrong. In fact I said
 something like...; The code I put in the real PHP page however is correct, 
identical to what you write above, copied straight from a
 manual: the proof is that otherwise it  would not have printed the
 other form fields as reported, right?

Again, I'll try the reset instructino tonight and report. In the meantime
any other hypothesis is welcome


Thanks,

mweb


--
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] HTTP_POST_VARS and eval?

2001-11-15 Thread Henrik Hudson

Hey List-

Working on a program and I seem to have run into a problem with 
HTTP_POST_VARS. Are the HTTP_VARS considered special?

Here is what I am doing, reading in from a file into an array and then 
grabbing each line and looking for  ]string[  and replacing that with  
$HTTP_POST_VARS[string]

The first echo prints out the lines correctly, but the echo after the eval 
prints out the same lines. My error log shows this:

PHP Parse error:  parse error, expecting `T_STRING' or `T_VARIABLE' or 
`T_NUM_STRING' in 
/data/www/webpages/test.rhavenn.net/public_html/formmail/formmail.php(164) : 
eval()'d code on line 1


So, its having problems doing an eval on the HTTP_POST? If I replace the 
HTTP_POST stuff with just$\\1  and then define $string = 
$HTTP_POST_VARS[string] it works just fine, but I can't do this since I 
don't know what string is going to be, just that it is between ] [  chars and 
there can be multiple ] [  on one line.

Any thoughts? Code is below.

//Read the array
$form_data = ;
for($i=0; $i  count($filearr); $i++){
$line = $filearr[$i];
//Strip the ] [ from around the variables so they will be interpreted
$line = eregi_replace(\]([^\[]+)\[, \$HTTP_POST_VARS['\\1'], 
$line);
echo Line: $lineBR;
//eval the variables from $line into themselves and they become 
literal
eval (\$line = \$line\;);
echo Lineafterwards: $lineBR\n;
//Write the line back into a single variable
$form_data = $form_data . $line;
}
exit;


Thanks!

Henrik
-- 

Henrik Hudson
[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] HTTP_POST_VARS: Data there, but can't get to it

2001-11-10 Thread Christopher William Wesley

Name the form element without the brackets ... just whatdo instead of
whatdo[].  When $whatdo[] makes it to your formhandler, it's an array.
(You _could_ access $whatdo[0] ... but that may or may not be more
confusing.)

~Chris   /\
 \ / September 11, 2001
  X  We Are All New Yorkers
 / \ rm -rf /bin/laden

On Sat, 10 Nov 2001, Lara J. Fabans wrote:

 Just an addendum, I changed it from radio buttons to a pop up menu

  p
select name=whatdo[] id=whatdo
  option value=load selectedLoad/option
  option value=deleteDelete/option
  option value=changeChange Category/option
/select
  /p


 Again, if I print_r (HTTP_POST_VARS), I can see the Array ( [whatdo] =
 Array ( [0] = load [1] = delete), [other
 stuff])
 but I cannot access it.  I'm doing the same exact syntax for the image
 name=image[] which works perfectly.

 I can find nothing on this in the documentation or any of the other
 wonderful books  websites out there.
 Please, what am I doing wrong in trying to access the HTTP_POST_VARS?

 Thanks,
 Lara


 At 08:36 AM 11/10/2001 -0800, Lara J. Fabans wrote:
 My bad for typing it in from memory. I'd retyped it in a few times, so I
 thought i had it perfect.  Here's the exact code:
 
 print_r ($HTTP_POSTVARS); // yeilds the array that I pasted down below
 if ($flag==process)
 {
 $whatdo = $HTTP_POSTVARS['whatdo'];
 print_r($what_do);   // blank
 .
 .
 .
 
   for ($x=0;$x=$row;$x++)
   {
 
   $whatdox = $whatdo[$x];
 print $whatdox;  // blank
 .
 .
 .
 //loop start
tr
  td nowrap
p
  input type=radio name=whatdo[?php print $row?] value=load
 checked
  Loadbr
  input type=radio name=whatdo[?php print $row?]
 value=delete
  Deletebr
  input type=radio name=whatdo[?php print $row?]
 value=change
  Change Category/p
  /td
 .
 .
 .
 
 -
 Lara J. Fabans
 Lodestone Software, Inc
 [EMAIL PROTECTED]
 
 
   At 09:41 AM 10/11/01, Lara J. Fabans wrote:
   Hi,
   
   I'm having some difficulties accessing HTTP_POST_VARS
   
   The original form has a table where each row has a set of 3 radio
   buttons  name=whatdo?php print $x?[]   where $x is the row counter.
   (I'm using PHP to pull info into a table, then the user manipulates
   the info, and it places the info into 2 other tables depending upon what
   the choice is for the 3 radio buttons).
   
   So, on submit, it reloads the page, and I pull in all of the areas.  All
   work except the radio buttons.
   
   I've tried:
   $submitted_vars = $HTTP_POST_VARS;
   $whatdo = $submitted_vars[whatdo];
   ---
   and
   $whatdo = $HTTP_POST_VARS[whatdo];
   --
   
   but when I do a print_r($whatdo)
   it's blank
   
   When I do a
   print_r($HTTP_POST_VARS)
   I get
   Array ( [whatdo] = Array ( [0] = load [1] = delete), [other
 stuff])
   
   
   What am I doing wrong :-)  How do I access this data?  It's so
 frustrating
   since all the rest of the postvars are working, and I can see that the
   data's there in the HTTP_POST_VARSI just can't get to it. (pun not
   intended)

 -
 Lara J. Fabans
 Lodestone Software, Inc
 [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 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] HTTP_POST_VARS: Data there, but can't get to it

2001-11-10 Thread Tom Rogers

Hi
This works (save as whatdo.php)

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN
html
headtitleWhatdo/title/head
body
?php
$rowcount = 2;
$row = 0;
//check for submit button pressed
if($submit == Submit):
 while($row  $rowcount):
 $postvar = whatdo-.$row;
 echo Row .$row. is .$HTTP_POST_VARS[$postvar].br;
 $row++;
 endwhile;
else:
?
table border=1 cellspacing=0 cellpadding=4
form action=whatdo.php method=post
?php
 while($row  $rowcount):
?
 tr
 tdRow ?php echo $row? Options/td
 td nowrap
 input type=radio name=whatdo-?php echo $row? 
value=loadcheckedLoadbr
 input type=radio name=whatdo-?php echo $row? 
value=deleteDeletebr
 input type=radio name=whatdo-?php echo $row? 
value=changeChange Category
 /td
 /tr
?php
 $row ++;
 endwhile;
?
 tr
 td colspan=2 align=centerinput type=submit 
name=submit value=Submit/td
 /tr
/form
/table
?php
endif;
?
/body
/html


-- 
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] HTTP_POST_VARS: Data there, but can't get to it

2001-11-10 Thread Lara J. Fabans

My bad for typing it in from memory. I'd retyped it in a few times, so I
thought i had it perfect.  Here's the exact code:

print_r ($HTTP_POSTVARS); // yeilds the array that I pasted down below
if ($flag==process)
{
$whatdo = $HTTP_POSTVARS['whatdo'];
print_r($what_do);   // blank
.
.
.

 for ($x=0;$x=$row;$x++)
 {

 $whatdox = $whatdo[$x];
print $whatdox;  // blank
.
.
.
//loop start
  tr
td nowrap
  p
input type=radio name=whatdo[?php print $row?] value=load
checked
Loadbr
input type=radio name=whatdo[?php print $row?]
value=delete
Deletebr
input type=radio name=whatdo[?php print $row?]
value=change
Change Category/p
/td
.
.
.

-
Lara J. Fabans
Lodestone Software, Inc
[EMAIL PROTECTED]


 At 09:41 AM 10/11/01, Lara J. Fabans wrote:
 Hi,
 
 I'm having some difficulties accessing HTTP_POST_VARS
 
 The original form has a table where each row has a set of 3 radio
 buttons  name=whatdo?php print $x?[]   where $x is the row counter.
 (I'm using PHP to pull info into a table, then the user manipulates
 the info, and it places the info into 2 other tables depending upon what
 the choice is for the 3 radio buttons).
 
 So, on submit, it reloads the page, and I pull in all of the areas.  All
 work except the radio buttons.
 
 I've tried:
 $submitted_vars = $HTTP_POST_VARS;
 $whatdo = $submitted_vars[whatdo];
 ---
 and
 $whatdo = $HTTP_POST_VARS[whatdo];
 --
 
 but when I do a print_r($whatdo)
 it's blank
 
 When I do a
 print_r($HTTP_POST_VARS)
 I get
 Array ( [whatdo] = Array ( [0] = load [1] = delete), [other
stuff])
 
 
 What am I doing wrong :-)  How do I access this data?  It's so
frustrating
 since all the rest of the postvars are working, and I can see that the
 data's there in the HTTP_POST_VARSI just can't get to it. (pun not
 intended)
 
 Thanks,
 Lara
 
 -
 Lara J. Fabans
 Lodestone Software, Inc
 [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 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] HTTP_POST_VARS: Data there, but can't get to it

2001-11-10 Thread Lara J. Fabans

Just an addendum, I changed it from radio buttons to a pop up menu

 p
   select name=whatdo[] id=whatdo
 option value=load selectedLoad/option
 option value=deleteDelete/option
 option value=changeChange Category/option
   /select
 /p


Again, if I print_r (HTTP_POST_VARS), I can see the Array ( [whatdo] = 
Array ( [0] = load [1] = delete), [other
stuff])
but I cannot access it.  I'm doing the same exact syntax for the image 
name=image[] which works perfectly.

I can find nothing on this in the documentation or any of the other 
wonderful books  websites out there.
Please, what am I doing wrong in trying to access the HTTP_POST_VARS?

Thanks,
Lara


At 08:36 AM 11/10/2001 -0800, Lara J. Fabans wrote:
My bad for typing it in from memory. I'd retyped it in a few times, so I
thought i had it perfect.  Here's the exact code:

print_r ($HTTP_POSTVARS); // yeilds the array that I pasted down below
if ($flag==process)
{
$whatdo = $HTTP_POSTVARS['whatdo'];
print_r($what_do);   // blank
.
.
.

  for ($x=0;$x=$row;$x++)
  {

  $whatdox = $whatdo[$x];
print $whatdox;  // blank
.
.
.
//loop start
   tr
 td nowrap
   p
 input type=radio name=whatdo[?php print $row?] value=load
checked
 Loadbr
 input type=radio name=whatdo[?php print $row?]
value=delete
 Deletebr
 input type=radio name=whatdo[?php print $row?]
value=change
 Change Category/p
 /td
.
.
.

-
Lara J. Fabans
Lodestone Software, Inc
[EMAIL PROTECTED]


  At 09:41 AM 10/11/01, Lara J. Fabans wrote:
  Hi,
  
  I'm having some difficulties accessing HTTP_POST_VARS
  
  The original form has a table where each row has a set of 3 radio
  buttons  name=whatdo?php print $x?[]   where $x is the row counter.
  (I'm using PHP to pull info into a table, then the user manipulates
  the info, and it places the info into 2 other tables depending upon what
  the choice is for the 3 radio buttons).
  
  So, on submit, it reloads the page, and I pull in all of the areas.  All
  work except the radio buttons.
  
  I've tried:
  $submitted_vars = $HTTP_POST_VARS;
  $whatdo = $submitted_vars[whatdo];
  ---
  and
  $whatdo = $HTTP_POST_VARS[whatdo];
  --
  
  but when I do a print_r($whatdo)
  it's blank
  
  When I do a
  print_r($HTTP_POST_VARS)
  I get
  Array ( [whatdo] = Array ( [0] = load [1] = delete), [other
stuff])
  
  
  What am I doing wrong :-)  How do I access this data?  It's so
frustrating
  since all the rest of the postvars are working, and I can see that the
  data's there in the HTTP_POST_VARSI just can't get to it. (pun not
  intended)

-
Lara J. Fabans
Lodestone Software, Inc
[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] HTTP_POST_VARS: Data there, but can't get to it

2001-11-09 Thread Lara J. Fabans

Hi,

I'm having some difficulties accessing HTTP_POST_VARS

The original form has a table where each row has a set of 3 radio
buttons  name=whatdo?php print $x?[]   where $x is the row counter.
(I'm using PHP to pull info into a table, then the user manipulates
the info, and it places the info into 2 other tables depending upon what
the choice is for the 3 radio buttons).

So, on submit, it reloads the page, and I pull in all of the areas.  All
work except the radio buttons.

I've tried:
$submitted_vars = $HTTP_POST_VARS;
$whatdo = $submitted_vars[whatdo];
---
and
$whatdo = $HTTP_POST_VARS[whatdo];
--

but when I do a print_r($whatdo)
it's blank

When I do a
print_r($HTTP_POST_VARS)
I get
Array ( [whatdo] = Array ( [0] = load [1] = delete), [other stuff])


What am I doing wrong :-)  How do I access this data?  It's so frustrating
since all the rest of the postvars are working, and I can see that the
data's there in the HTTP_POST_VARSI just can't get to it. (pun not
intended)

Thanks,
Lara

-
Lara J. Fabans
Lodestone Software, Inc
[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] HTTP_POST_VARS: Data there, but can't get to it

2001-11-09 Thread Christopher William Wesley

On Fri, 9 Nov 2001, Lara J. Fabans wrote:

 The original form has a table where each row has a set of 3 radio
 buttons  name=whatdo?php print $x?[]   where $x is the row counter.

Well, for a set of raido buttons, they should all have the same name.
In your case, all 3 radio buttons should be named whatdo.
Don't put on any brackets ... that will cause whatdo to be an array when
it's being handled by the form handler.

Then you can check $HTTP_POST_VARS['whatdo'] for the value of the checked
radio button when the form was submitted.

g.luck,
~Chris   /\
 \ / September 11, 2001
  X  We Are All New Yorkers
 / \ rm -rf /bin/laden



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

2001-09-12 Thread Jochen Kaechelin

Is this a secure way to check if some
data comes from a form-field of the
previous page, or ist it possible to
fill it without submitting a form?


-- 
Jochen

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

2001-08-27 Thread Andy Ladouceur

Hello all,
I am wondering if there is a command or function to get a list of all the
current '$HTTP_POST_VARS[variable]' variables? Or, a user-created way...
Any helps appreciated, thanks!
-Andy L.



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

2001-08-27 Thread Tim


while (list($k,$v) = each($HTTP_POST_VARS)) {
echo br$k = $v;
}

On Mon, 2001-08-27 at 21:48, Andy Ladouceur wrote:
 Hello all,
 I am wondering if there is a command or function to get a list of all the
 current '$HTTP_POST_VARS[variable]' variables? Or, a user-created way...
 Any helps appreciated, thanks!
 -Andy L.
 
 
 



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

2001-08-27 Thread Jason Murray

 I am wondering if there is a command or function to get a 
 list of all the current '$HTTP_POST_VARS[variable]' variables? 
 Or, a user-created way... Any helps appreciated, thanks!

You can use var_dump($HTTP_POST_VARS);

Jason

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

2001-08-27 Thread Andy Ladouceur

Ah, its that simple?
-feels likea bit of an idiot-
Thanks for the help!
Tim [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 while (list($k,$v) = each($HTTP_POST_VARS)) {
 echo br$k = $v;
 }

 On Mon, 2001-08-27 at 21:48, Andy Ladouceur wrote:
  Hello all,
  I am wondering if there is a command or function to get a list of all
the
  current '$HTTP_POST_VARS[variable]' variables? Or, a user-created
way...
  Any helps appreciated, thanks!
  -Andy L.
 
 
 





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

2001-08-27 Thread Andy Ladouceur

Thanks!
-Andy
Jason Murray [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  I am wondering if there is a command or function to get a
  list of all the current '$HTTP_POST_VARS[variable]' variables?
  Or, a user-created way... Any helps appreciated, thanks!

 You can use var_dump($HTTP_POST_VARS);

 Jason



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

2001-08-27 Thread pierre-yves

something like this...

  if( sizeof( $HTTP_POST_VARS )  0 ){  // avoid error when no vars
while ( list ( $key, $val ) = each ( $HTTP_POST_VARS )) {
  print br$key = $val;
}
  }


py

- Original Message -
From: Andy Ladouceur [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, August 27, 2001 9:48 PM
Subject: [PHP] $HTTP_POST_VARS


 Hello all,
 I am wondering if there is a command or function to get a list of all the
 current '$HTTP_POST_VARS[variable]' variables? Or, a user-created way...
 Any helps appreciated, thanks!
 -Andy L.



 --
 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] HTTP_POST_VARS not picking up checkboxes that areunchecked

2001-06-20 Thread Jens Nedal

The thing can do is as follows:

When i want check such empty boxes, i call up the $HTTP_POST_VARS just like
you. BUT what i do next ist that while listing those vars i insert an if
statement like

if (!strstr($key,checkbox_name)) {echo ($error);}

So i do a stringmatch with the key and the name... this way you can check
all checkboxes if the have generic starting like check_01 check_02 so then
you just ask if (!strstr($key,chec)) {echo ($error);}

For strstr function see the manual if you dont know.

Another way is as follows...
And its probably the best!.

You can start putting checkbox values into an array... like this
input type=checkbox name=?php echo(cb_[$i]); ? value=bla

cb_ then represents the array and THIS array gets transported within the
$HTTP_POST_VARS or rather exists as long as the page is up or reloaded.

Inside the listing of $HTTP_POST_VARS you then just do another array listing
for the cb_ array like this:

while (list($key, $val) = each($HTTP_POST_VARS)) {
if (strstr($key,'cb_')) {
$v_ok=1;
while (list($key, $val) = each($cb_)) {
$v_liste.=' '.$val;
$v_user_liste =
eregi_replace($val,,$user_liste);
}
}
}

The only backdrop is that you would have to initilaize those array elements
with an '' before

Works very nicely for me though.. since most checkbox elements are groups
and get pulled out of a database. So the initializing is generic too ;)

Maybe this helps, regards Jens



on 19.06.2001 1:46 Uhr, Tom Beidler at [EMAIL PROTECTED] wrote:

 I have a form with approximately 40 input fields. When a form is posted it
 sends an email and then builds a tab delimited $txt entry for a text file on
 the server.
 
 The problem is that if a checkbox is not checked, when it's not required, I
 don't get a blank entry in my tab file for the checkbox input. I'm imploding
 my HTTP_POST_VARS variable like so;
 
 reset($HTTP_POST_VARS);
 while (list($var, $value) = each($HTTP_POST_VARS)) {
 if (is_array($value)){
 $txt .= implode($value, \t);
 $txt .= \t;
 }
 else{
 $txt .= $value\t;
 }
 }
 $txt .= end\n;
 $flsfile = fopen(text/fls.txt, a);
 if ($flsfile){
 fputs($flsfile, $txt);
 fclose($flsfile);
 }
 
 Is there a way to send a blank value if the checkbox is not set? Should I
 use a completely different strategy? Have I said Thank you enough to Rasmus
 Lerdorf and whomever else was involved in resuscitating the list?
 
 Thanks Rasmus Lerdorf and all others involved for getting the list back up
 and running.
 
 
 .
 Tom Beidler
 Orbit Tech Services
 805.682.8972 (phone)
 805.682.5833 (fax)
 [EMAIL PROTECTED]
 http://www.orbittechservices.com/
 .
 
 




Re: [PHP] HTTP_POST_VARS not picking up checkboxes that are unchecked

2001-06-20 Thread Hugh Bothwell


Tom Beidler [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I have a form with approximately 40 input fields. When a form is posted it
 sends an email and then builds a tab delimited $txt entry for a text file
on
 the server.

 The problem is that if a checkbox is not checked, when it's not required,
I
 don't get a blank entry in my tab file for the checkbox input. I'm
imploding
(snip)
 Is there a way to send a blank value if the checkbox is not set? Should I
 use a completely different strategy? Have I said Thank you enough to
Rasmus
 Lerdorf and whomever else was involved in resuscitating the list?


I've had a similar project kicking about in my head, and this post finally
got me to try a few things.

The idea I had was for a multi-questionnaire system, where surveys are
created from a database query, scored by a common marking script, and the
results stored back to the database.  Obviously, the marking script can't
know what inputs to expect...

My first idea was to create a parseable variable-names-to-look-for
variable, but that seemed unwieldy.  Then I recalled someone complaining
about not being able to retrieve multiple input fields with the same name -
they only get the last ie most recent field set.  ;-) and there's the
answer.

If you have a hidden input with the same name and a default value _before_
your checkbox input, then your checkbox will over-write it if it's checked;
otherwise you receive the default value!

ie
input type=hidden name=myvariable value=No
input type=checkbox name=myvariable value=Yes

if the checkbox is checked, $myvariable = Yes, otherwise $myvariable =
No - exactly what you were looking for.

Better yet, because $myvariable only occurs once among the POSTed variables,
you can simply iterate through them, ie
foreach($HTTP_POST_VARS as $name = $val)
$outstr .= br$name: $val;

See the attached file, 'test.php', for a simply demo.


begin 666 test.php
M/#]P:' *21S='(@/2 B(CL*69OF5A8V@H)$A45%!?4$]35%]605)3(%S
M(1N86UE(#T^(1V86PI('L*0DDW1R(X]((\8G(^)YA;64@+29G=#L@
M(CL*0D*0EI9B H)'9A; ]/2 B(BD*0D))'-TB N/2 B*5M'1Y*2([
M@D)96QS90H)0DDW1R(X](1V86P[@E]@H_/@H\(41/0U194$4@2%1-
M3!054),24,@(BTO+US0R\O1%1$($A434P@-XP(%1R86YS:71I;VYA;\O
M14XB/@H\:'1M;#X*/AE860^@D\=ET;4^56YT:71L960\+W1I=QE/@H\
M+VAE860^CQB;V1Y/@H)/@Q/E1EW0@;7D@8VAE8VMB;W@M=F%L=64MV]L
M=F5R(ED96$\+V@Q/@H)/#\](1S='(@/SX*3QF;W)M(UE=AO9#TB]S
M=(@86-T:6]N/2(C(CX*0D\=%B;4^@D)3QTCX*0D)3QT9#Y;($9I
M;QE9!\($5M'1Y(%T\+W1D/@H)0D)/EN'5T('1Y4](FAI91E;B(@
M;F%M93TB9FEL;5D96UP='DB('9A;'5E/2(B/@H)0D)/'1D/CQI;G!U=!T
M7!E/2)C:5C:V)O(@;F%M93TB9FEL;5D96UP='DB('9A;'5E/2)F:6QL
M960B/CPO=0^@D)3PO='(^@D)3QTCX*0D)3QT9#Y;($)L=64@?!'
MF5E;B!=/]T9#X*0D)3QI;G!U=!T7!E/2)H:61D96XB(YA;64](F)L
M=65GF5E;B(@=F%L=64](D=R965N(CX*0D)3QT9#X\:6YP=70@='EP93TB
M8VAE8VMB;W@B(YA;64](F)L=65GF5E;B(@=F%L=64](D)L=64B/CPO=0^
M@D)3PO='(^@D)3QTCX*0D)3QT9#Y;(%EER!\($YO(%T\+W1D/@H)
M0D)/EN'5T('1Y4](FAI91E;B(@;F%M93TB65S;F\B('9A;'5E/2).
M;R(^@D)0D\=0^/EN'5T('1Y4](F-H96-K8F]X(B!N86UE/2)Y97-N
M;R(@=F%L=64](EEER(^/]T9#X*0D)/]TCX*0D\+W1A8FQE/@H)3QI
M;G!U=!T7!E/2)S=6)M:70B/@H)/]F;W)M/@H*/]B;V1Y/@H\+VAT;6P^
!@``
`
end


-- 
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] HTTP_POST_VARS not picking up checkboxes that are unchecked

2001-06-19 Thread Jason Murray

 Subject: [PHP] HTTP_POST_VARS not picking up checkboxes that are unchecked

That's right - if the checkbox isn't checked the browser doesn't send it. 

Jason



Re: [PHP] HTTP_POST_VARS not picking up checkboxes that are unchecked

2001-06-19 Thread Rasmus Lerdorf

 The problem is that if a checkbox is not checked, when it's not required, I
 don't get a blank entry in my tab file for the checkbox input. I'm imploding
 my HTTP_POST_VARS variable like so;

This has nothing to do with PHP.  Your browser sends nothing for an
unchecked checkbox.  You would have to work around this either by knowing
in your code the complete list of checkboxes, or perhaps adding hidden
fields in your HTML.

-Rasmus




RE: [PHP] HTTP_POST_VARS not picking up checkboxes that are unchecked

2001-06-19 Thread John Monfort



   I had some issues with that recently. It turns out that PHP will not
   pick up the checkboxes, unless you use the GET method.

   You can then access your vars with HTTP_GET_VARS.

   This was discovered on
WIN98+ PHP 4.03pl1 + Apache 1.3++
 
WIN ME + PHP 4.03pl1 + Apache 1.3++

   If someone had a different experience, then I would like to hear about
   it. Please share.

__John Monfort_
_+---+_
 P E P I E  D E S I G N S
   www.pepiedesigns.com
The world is waiting, are you ready?
-+___+-

On Tue, 19 Jun 2001, Jason Murray wrote:

  Subject: [PHP] HTTP_POST_VARS not picking up checkboxes that are unchecked

 That's right - if the checkbox isn't checked the browser doesn't send it.

 Jason





RE: [PHP] HTTP_POST_VARS not picking up checkboxes that are unche cked

2001-06-19 Thread Merio, Quinn


This is how i get around it.

On the form page:

input type=checkbox name=SUBSCRIBE value=YES checked


On the submission page:

if (empty($SUBSCRIBE)) { 
$SUBSCRIBE = NO;
}

hth,
quinn merio
www.vr2a.com




-Original Message-
From: John Monfort [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 19, 2001 6:20 AM
To: Jason Murray
Cc: 'Tom Beidler'; [EMAIL PROTECTED]
Subject: RE: [PHP] HTTP_POST_VARS not picking up checkboxes that are
unche cked




   I had some issues with that recently. It turns out that PHP will not
   pick up the checkboxes, unless you use the GET method.

   You can then access your vars with HTTP_GET_VARS.

   This was discovered on
WIN98+ PHP 4.03pl1 + Apache 1.3++
 
WIN ME + PHP 4.03pl1 + Apache 1.3++

   If someone had a different experience, then I would like to hear about
   it. Please share.

__John Monfort_
_+---+_
 P E P I E  D E S I G N S
   www.pepiedesigns.com
The world is waiting, are you ready?
-+___+-

On Tue, 19 Jun 2001, Jason Murray wrote:

  Subject: [PHP] HTTP_POST_VARS not picking up checkboxes that are
unchecked

 That's right - if the checkbox isn't checked the browser doesn't send it.

 Jason




[PHP] HTTP_POST_VARS not picking up checkboxes that are unchecked

2001-06-18 Thread Tom Beidler

I have a form with approximately 40 input fields. When a form is posted it
sends an email and then builds a tab delimited $txt entry for a text file on
the server.

The problem is that if a checkbox is not checked, when it's not required, I
don't get a blank entry in my tab file for the checkbox input. I'm imploding
my HTTP_POST_VARS variable like so;

reset($HTTP_POST_VARS);
  while (list($var, $value) = each($HTTP_POST_VARS)) {
if (is_array($value)){
  $txt .= implode($value, \t);
  $txt .= \t;
}
else{
  $txt .= $value\t;
}
 }
 $txt .= end\n;
 $flsfile = fopen(text/fls.txt, a);
 if ($flsfile){
fputs($flsfile, $txt);
fclose($flsfile);
 }

Is there a way to send a blank value if the checkbox is not set? Should I
use a completely different strategy? Have I said Thank you enough to Rasmus
Lerdorf and whomever else was involved in resuscitating the list?

Thanks Rasmus Lerdorf and all others involved for getting the list back up
and running.


.
Tom Beidler
Orbit Tech Services
805.682.8972 (phone)
805.682.5833 (fax)
[EMAIL PROTECTED]
http://www.orbittechservices.com/
.





Re: [PHP] HTTP_POST_VARS not and array when used in a function?

2001-04-18 Thread Alexander Skwar

So sprach Joseph Blythe am Wed, Apr 18, 2001 at 10:48:14AM +0930:
 Hey,
 
 Why doesn't HTTP_POST_VARS work inside functions?
 
 ---somefile.php - forms action ---
 
 function foo() {
reset($HTTP_POST_VARS);

Because this particular HTTP_POST_VARS is not the HTTP_POST_VARS you have
outside the function.  Either you pass it along as a parameter, or you do:

global $HTTP_POST_VARS;

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die gnstige Art an Linux Distributionen zu kommen
Uptime: 1 day 10 hours 18 minutes

--
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] HTTP_POST_VARS variable names?

2001-04-18 Thread Mat Marlow

Hi,
Does anyone know if php stores POST variable names as well as values? I'm
using HTTP_POST_VARS for the values but I'm having to create my own array
for the names.

cheers,

Mat



-- 
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] HTTP_POST_VARS variable names?

2001-04-18 Thread Johannes Janson

Hi,

this will list all your posted variables with name and
the posted value.

while (list($key, $value)=each($HTTP_POST_VARS) ) {
echo "$key = $value br";
}

Johannes

""Mat Marlow"" [EMAIL PROTECTED] schrieb im Newsbeitrag
9bk11q$dvq$[EMAIL PROTECTED]">news:9bk11q$dvq$[EMAIL PROTECTED]...
 Hi,
 Does anyone know if php stores POST variable names as well as values? I'm
 using HTTP_POST_VARS for the values but I'm having to create my own array
 for the names.

 cheers,

 Mat



 --
 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] HTTP_POST_VARS variable names?

2001-04-18 Thread Renze Munnik

Mat Marlow wrote:
 
 Hi,
 Does anyone know if php stores POST variable names as well as values? I'm
 using HTTP_POST_VARS for the values but I'm having to create my own array
 for the names.
 
 cheers,
 
 Mat
 
 --
 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]


Correct me if I misunderstand you're question, but;

If you use HTTP_POST_VARS you already have the variable names. I
mean... how else do you use the values you're talking about?
$HTTP_POST_VARS{"var_1"}, $HTTP_POST_VARS{"var_2"}, etc.
var_1 and var_2 are the variable names...
-- 

* RzE:

***
**  Renze Munnik
**
**  E: [EMAIL PROTECTED]
**  M: +31 6 218 111 43
***

-- 
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] HTTP_POST_VARS variable names?

2001-04-18 Thread Plutarck

Quick answer: HTTP_POST_VARS is an associative array. The "name" of the
submitted variables are the keys, and the value of the element is the value
that was submitted.


--
Plutarck
Should be working on something...
...but forgot what it was.


""Mat Marlow"" [EMAIL PROTECTED] wrote in message
9bk11q$dvq$[EMAIL PROTECTED]">news:9bk11q$dvq$[EMAIL PROTECTED]...
 Hi,
 Does anyone know if php stores POST variable names as well as values? I'm
 using HTTP_POST_VARS for the values but I'm having to create my own array
 for the names.

 cheers,

 Mat



 --
 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] HTTP_POST_VARS not and array when used in a function?

2001-04-17 Thread Rasmus Lerdorf

 I thought the above would work but it returns the following error(s):

 ...  value passed to reset is not an array or object ...
 ... value passed to each is not an array or object ...

 It seems that HTTP_POST_VARS does not like being called from inside
 functions, as the above will work if not inside the function,  I thought
 that HTTP_POST_VARS was in the global scope (as of php 4.0.3 track-vars
 is always on) , so it should have no problem being called from anywhere?

 Does anyone know what gives?

It is a normal global variable.  Like all other global variables you need
to declare the fact that you want the global variable inside a function.
Simply put: global $HTTP_POST_VARS; at the top of your function and it
will work just fine.

Read the section on variable scope in the PHP documentation.

-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] HTTP_POST_VARS not and array when used in a function?

2001-04-17 Thread Joseph Blythe

Rasmus Lerdorf wrote:

 It is a normal global variable.  Like all other global variables you need
 to declare the fact that you want the global variable inside a function.
 Simply put: global $HTTP_POST_VARS; at the top of your function and it
 will work just fine.
 
 Read the section on variable scope in the PHP documentation.


Thanks Rasmus,

I should really be tarred and feathered eh :-)

Joseph



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

2001-04-12 Thread Mat Marlow

Hi all,
I'm having trouble retrieving data from $HTTP_POST_VARS. Whenever I try to
print something from it using print($HTTP_POST_VARS[0]); it just prints
"Array". And I know it works because I've done it once and can't do it
again!
Am I missing something glaringly obvious?

Thanks for the help,

Mat
PS. track_vars is ON!



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

2001-04-12 Thread Dominick Vansevenant

Mat,

did you put in a reset?

reset($HTTP_POST_VARS);

D.

-Original Message-
From: Mat Marlow [mailto:[EMAIL PROTECTED]]
Sent: donderdag 12 april 2001 16:49
To: [EMAIL PROTECTED]
Subject: [PHP] HTTP_POST_VARS


Hi all,
I'm having trouble retrieving data from $HTTP_POST_VARS. Whenever I try to
print something from it using print($HTTP_POST_VARS[0]); it just prints
"Array". And I know it works because I've done it once and can't do it
again!
Am I missing something glaringly obvious?

Thanks for the help,

Mat
PS. track_vars is ON!



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

2001-04-12 Thread Plutarck

Try doing a print_r in the place where you are trying to print data.

So you can see if a second dimension slipped in there, or if there is some
other problem.

I know that the post/get vars are always associative arrays, but I assume
refering to them by their numeric keys should work...don't see why it
wouldn't.


--
Plutarck
Should be working on something...
...but forgot what it was.


""Mat Marlow"" [EMAIL PROTECTED] wrote in message
9b4f3s$3uo$[EMAIL PROTECTED]">news:9b4f3s$3uo$[EMAIL PROTECTED]...
 Hi all,
 I'm having trouble retrieving data from $HTTP_POST_VARS. Whenever I try to
 print something from it using print($HTTP_POST_VARS[0]); it just prints
 "Array". And I know it works because I've done it once and can't do it
 again!
 Am I missing something glaringly obvious?

 Thanks for the help,

 Mat
 PS. track_vars is ON!



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

2001-04-12 Thread Steve Edberg

At 4:50 PM +0200 4/12/01, Dominick Vansevenant [EMAIL PROTECTED] wrote:
Mat,

did you put in a reset?

reset($HTTP_POST_VARS);

D.


Yes, you'll need the reset() there if you're looping through the 
$HTTP_POST_VARS array more than once. However:

I take it that you were trying something like

echo $HTTP_POST_VARS[0];

? If so, you will indeed get the output 'array' if element 0 is an 
array. As someone suggested, you can use the print_r() or var_dump() 
functions (print_r, I think, is PHP4 only) to display it. You can 
also do something like

...

if (is_array($HTTP_POST_VARS[0])) {

   while (list($k,$v)=each($HTTP_POST_VARS[0])) {
  echo '$HTTP_POST_VARS[0]', "[$k] = $vbr";
   }

} else {

   echo '$HTTP_POST_VARS[0] = ', $HTTP_POST_VARS[0];

}

...

In PHP3, POST/GET elements could only be one dimensional arrays, at 
most. In PHP4, though, these can have 2+ dimensions, so for maximum 
generality you'd have to have somewhat more complex code than this.

-steve


-Original Message-
From: Mat Marlow [mailto:[EMAIL PROTECTED]]
Sent: donderdag 12 april 2001 16:49
To: [EMAIL PROTECTED]
Subject: [PHP] HTTP_POST_VARS


Hi all,
I'm having trouble retrieving data from $HTTP_POST_VARS. Whenever I try to
print something from it using print($HTTP_POST_VARS[0]); it just prints
"Array". And I know it works because I've done it once and can't do it
again!
Am I missing something glaringly obvious?

Thanks for the help,

Mat
PS. track_vars is ON!


-- 
+--- 12 April 2001: Forty years of manned spaceflight ---+
| Steve Edberg   University of California, Davis |
| [EMAIL PROTECTED]   Computer Consultant |
| http://aesric.ucdavis.edu/  http://pgfsun.ucdavis.edu/ |
+-- www.yurisnight.net --+

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

2001-03-13 Thread David Minor

I am having a similar problem as the original poster.  In my case, I _want_
the second sumbission to overwrite the first, but it's not happening.  What
I have is a radio button list all named="update" each with it's own value
(ie. 2,3,4,5,etc.).  The form is self-submitting and tests on 'update' to
know how to proceed.  What I'm experiencing is that after the first
submission, printing out '$HTTP_POST_VARS' array gives the correct update
value.  Subsequent submissions also show this same value no matter what
value is selected in the form.

I've tried using 'unset($HTTP_POST_VARS[update]);' at the end of the script
after the var has been used and reprintingg the HTTP_POST_VARS array which
shows that it was unset, but on resubmission of the form, it reappears!

losing hair,
David Minor

on 3/8/01 5:45 PM, [EMAIL PROTECTED] at
[EMAIL PROTECTED] wrote:

 Explained here:
 http://www.php.net/manual/en/language.variables.external.php
 
 Basically name the variables with [].  For example:
 
 input type=text name="Name[]"
 
 In your example, the second is actually overwriting the first.
 
 
 Nate
 
 -Original Message-
 From: mat t [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, March 08, 2001 3:10 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] $HTTP_POST_VARS
 
 
 Please can you help:
 
 I can't send duplicate input types to $HTTP_POST_VARS
 For example:
 ---HTML---
 First person:
 
 NAME input type="text" name="Name" size="24" value=""
 input name="Name_type" type="hidden" value="textbox"
 
 Phone No.input type="text" name="Phone" size="24" value=""
 input name="Phone_type" type="hidden" value="textbox"
 
 Second Person:
 
 NAME input type="text" name="Name" size="24" value=""
 input name="Name_type" type="hidden" value="textbox"
 
 Phone No.input type="text" name="Phone" size="24" value=""
 input name="Phone_type" type="hidden" value="textbox"
 
 ---
 
 Then when I use :
 
 reset ($HTTP_POST_VARS);
 while (list ($key, $val) = each ($HTTP_POST_VARS))
 {
 echo "$key = $valbr\n";
 }
 
 Here is the output
 
 Output--
 
 Name = 
 Name_type = textbox
 Phone = 
 Phone_type = textbox
 
 
 
 What happened to the Second person?
 How can I stop it ignoring duplicates and insert in the array 1 by 1?
 


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

2001-03-13 Thread Dennis Gearon

Check your browser settings, I had this problem when I had the 'check
page never' setting selected, and it went away when I set it to 'check
every session'

I am having a similar problem as the original poster.  In my case, I _want_
the second sumbission to overwrite the first, but it's not happening.  What
I have is a radio button list all named="update" each with it's own value
(ie. 2,3,4,5,etc.).  The form is self-submitting and tests on 'update' to
know how to proceed.  What I'm experiencing is that after the first
submission, printing out '$HTTP_POST_VARS' array gives the correct update
value.  Subsequent submissions also show this same value no matter what
value is selected in the form.

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

2001-03-12 Thread stas

Hello,

Is it that correct that only non-empty variables get inserted into HTTP_POST_VARS? I 
am trying to do server side form validations, and this represents a bit of difficulty 
in terms of notifying a user about which fields are missing values.



Re: [PHP] HTTP_POST_VARS

2001-03-12 Thread Yasuo Ohgaki

No.

Check box and radio buttons are not set, though.

Regards,

--
Yasuo Ohgaki

""stas"" [EMAIL PROTECTED] wrote in message
026001c07cc4$aeaa6250$9701a8c0@snewdel">news:026001c07cc4$aeaa6250$9701a8c0@snewdel...
Hello,

Is it that correct that only non-empty variables get inserted into
HTTP_POST_VARS? I am trying to do server side form validations, and this
represents a bit of difficulty in terms of notifying a user about which fields
are missing values.



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

2001-03-08 Thread mat t

Please can you help:

I can't send duplicate input types to $HTTP_POST_VARS
For example:
---HTML---
First person:

NAME input type="text" name="Name" size="24" value=""
input name="Name_type" type="hidden" value="textbox"

Phone No.input type="text" name="Phone" size="24" value=""
input name="Phone_type" type="hidden" value="textbox" 

Second Person:

NAME input type="text" name="Name" size="24" value=""
input name="Name_type" type="hidden" value="textbox"

Phone No.input type="text" name="Phone" size="24" value=""
input name="Phone_type" type="hidden" value="textbox"

---

Then when I use :

reset ($HTTP_POST_VARS);
while (list ($key, $val) = each ($HTTP_POST_VARS))
  {
echo "$key = $valbr\n";
  }

Here is the output

Output--

Name = 
Name_type = textbox
Phone = 
Phone_type = textbox



What happened to the Second person?
How can I stop it ignoring duplicates and insert in the array 1 by 1?


_
Pick up your email anywhere in the world --- http://www.remail.net

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

2001-03-08 Thread Jerry Lake

You're not setting a value for the first variable ie.."Name"
unless you put something in the text box to represent the variable
it will come across as empty.

Jerry Lake- [EMAIL PROTECTED]
Web Designer
Europa Communications - http://www.europa.com
Pacifier Online - http://www.pacifier.com


-Original Message-
From: mat t [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 08, 2001 2:10 PM
To: [EMAIL PROTECTED]
Subject: [PHP] $HTTP_POST_VARS


Please can you help:

I can't send duplicate input types to $HTTP_POST_VARS
For example:
---HTML---
First person:

NAME input type="text" name="Name" size="24" value=""
input name="Name_type" type="hidden" value="textbox"

Phone No.input type="text" name="Phone" size="24" value=""
input name="Phone_type" type="hidden" value="textbox" 

Second Person:

NAME input type="text" name="Name" size="24" value=""
input name="Name_type" type="hidden" value="textbox"

Phone No.input type="text" name="Phone" size="24" value=""
input name="Phone_type" type="hidden" value="textbox"

---

Then when I use :

reset ($HTTP_POST_VARS);
while (list ($key, $val) = each ($HTTP_POST_VARS))
  {
echo "$key = $valbr\n";
  }

Here is the output

Output--

Name = 
Name_type = textbox
Phone = 
Phone_type = textbox



What happened to the Second person?
How can I stop it ignoring duplicates and insert in the array 1 by 1?


_
Pick up your email anywhere in the world --- http://www.remail.net

-- 
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] Newbie: [PHP] $HTTP_POST_VARS

2001-02-20 Thread Phil Labonte

I have a Newbie question,

What is the syntax to get the info from HHTP_POST_VARS?

I mean what is the syntax to get the variable COMPUTERNAME for example or to
get HTTP_HOST?

Thanks


Phil Labonte
Systems Administrator
Atreus Systems
(p) 613-233-1741 x243
(c) 613-277-1697
[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] Newbie: [PHP] $HTTP_POST_VARS

2001-02-20 Thread Chris Lee

I dont think HTTP_POST_VARS is what your looking for I think its more
HTTP_SERVER_VARS

?php
echo $HTTP_SERVER_VARS['HTTP_HOST'];
?


--


Chris Lee
Mediawaveonline.com

em. [EMAIL PROTECTED]

ph. 250.377.1095
ph. 250.376.2690
fx. 250.554.1120



""Phil Labonte"" [EMAIL PROTECTED] wrote in message
331AB909C797484B84CF8CF3C711BD4E0992A2@xchange">news:331AB909C797484B84CF8CF3C711BD4E0992A2@xchange...
 I have a Newbie question,

 What is the syntax to get the info from HHTP_POST_VARS?

 I mean what is the syntax to get the variable COMPUTERNAME for example or
to
 get HTTP_HOST?

 Thanks


 Phil Labonte
 Systems Administrator
 Atreus Systems
 (p) 613-233-1741 x243
 (c) 613-277-1697
 [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 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] Newbie: [PHP] $HTTP_POST_VARS

2001-02-20 Thread Jerry Lake

or 
?
phpinfo();
?

for an entire list of php setup and http variables

Jerry Lake- [EMAIL PROTECTED]
Web Designer
Europa Communications - http://www.europa.com
Pacifier Online - http://www.pacifier.com


-Original Message-
From: Chris Lee [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 20, 2001 2:08 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Newbie: [PHP] $HTTP_POST_VARS


I dont think HTTP_POST_VARS is what your looking for I think its more
HTTP_SERVER_VARS

?php
echo $HTTP_SERVER_VARS['HTTP_HOST'];
?


--


Chris Lee
Mediawaveonline.com

em. [EMAIL PROTECTED]

ph. 250.377.1095
ph. 250.376.2690
fx. 250.554.1120



""Phil Labonte"" [EMAIL PROTECTED] wrote in message
331AB909C797484B84CF8CF3C711BD4E0992A2@xchange">news:331AB909C797484B84CF8CF3C711BD4E0992A2@xchange...
 I have a Newbie question,

 What is the syntax to get the info from HHTP_POST_VARS?

 I mean what is the syntax to get the variable COMPUTERNAME for example or
to
 get HTTP_HOST?

 Thanks


 Phil Labonte
 Systems Administrator
 Atreus Systems
 (p) 613-233-1741 x243
 (c) 613-277-1697
 [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 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] $HTTP_POST_VARS

2001-02-15 Thread Augusto Cesar Castoldi

   reset($HTTP_POST_VARS);
   while (list($key, $val) = each($HTTP_POST_VARS)) {
//print "$key - $valbr";
  if (substr($key,0,3) == "alt" or substr($key,0,3) == "exc")


Somebody can explain or indicate any site about this ($HTTP_POST_VARS)?

It is used to do menu in php. If the name of the button (input
type="image" name="back"...

then in php I use:

if ($back_x  0) {
  .
  .
  .
}

Augusto Cesar Castoldi


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