[PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup

2003-01-29 Thread CF High
Hey all.

This driving me nuts:

I've got Apache, MySql, and Windows 2000 running on my local machine.
In order to get passed php variables evaluated, whether via a url query
string, or through a form post, I have to use this syntax:

$_REQUEST[$my_passed_variable]

I have no such problem with our hosting company servers; i.e. I can access
query_string and form posted variables as $my_passed_variable.

What is going on here? Is there something in php.ini that needs to be
adjusted?

Any help whatsoever here is much appreciated,

--Noah

--




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




Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup

2003-01-29 Thread Ernest E Vogelsinger
At 01:36 30.01.2003, CF High said:
[snip]
However, setting register_globals on or off makes no difference. The 
variables are still not getting evaluated
[snip] 

I _BET_ it's register_globals.
Did you restart the webserver in case PHP is loaded as a module?

Anyway: it's a lot safer having register_globals set to off (see
http://www.php.net/manual/en/security.registerglobals.php#security.registerg
lobals for a discussion on security issues).

For example, assuming that a certain cookie value is available, with
register_globals on this value may be forged by passing the value as part
of the url. A lot of different possibilities arise.


-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup

2003-01-29 Thread Noah
Yup. Restarted Apache.

PHP's still not evaluating the passed form vars whether register globals is
set to On or Off

--Noah

- Original Message -
From: Ernest E Vogelsinger [EMAIL PROTECTED]
To: CF High [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Wednesday, January 29, 2003 2:23 PM
Subject: Re: [PHP] Form Variables not getting passed || Apache, MySql, Win
2k Setup


 At 01:36 30.01.2003, CF High said:
 [snip]
 However, setting register_globals on or off makes no difference. The
 variables are still not getting evaluated
 [snip]

 I _BET_ it's register_globals.
 Did you restart the webserver in case PHP is loaded as a module?

 Anyway: it's a lot safer having register_globals set to off (see

http://www.php.net/manual/en/security.registerglobals.php#security.registerg
 lobals for a discussion on security issues).

 For example, assuming that a certain cookie value is available, with
 register_globals on this value may be forged by passing the value as part
 of the url. A lot of different possibilities arise.


 --
O Ernest E. Vogelsinger
(\)ICQ #13394035
 ^ http://www.vogelsinger.at/




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




Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup

2003-01-29 Thread Noah
I don't want to use $_REQUEST['my_passed_variable'] at all.

Right now when I do an sql insert on my local machine I have to use the
following syntax:

INSERT into tablename (field name list)
VALUES ($_REQUEST['var1'],  $_REQUEST['var2'], $_REQUEST['var3'])

I just want to use $var1, $var2, $var3

--Noah

- Original Message -
From: Philip Olson [EMAIL PROTECTED]
To: CF High [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Wednesday, January 29, 2003 2:23 PM
Subject: Re: [PHP] Form Variables not getting passed || Apache, MySql, Win
2k Setup



 One too many $'s in your code, use:

 $_REQUEST['my_passed_variable']

 This is how all arrays work, autoglobals are the same.
 See also:

 http://www.php.net/variables.external
 http://www.php.net/variables.predefined

 Regards,
 Philip

 On Wed, 29 Jan 2003, CF High wrote:

  Hey all.
 
  This driving me nuts:
 
  I've got Apache, MySql, and Windows 2000 running on my local
machine.
  In order to get passed php variables evaluated, whether via a url query
  string, or through a form post, I have to use this syntax:
 
  $_REQUEST[$my_passed_variable]
 
  I have no such problem with our hosting company servers; i.e. I can
access
  query_string and form posted variables as $my_passed_variable.
 
  What is going on here? Is there something in php.ini that needs to be
  adjusted?
 
  Any help whatsoever here is much appreciated,
 
  --Noah
 
  --
 
 
 
 
  --
  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] Form Variables not getting passed || Apache, MySql, Win 2k Setup

2003-01-29 Thread Ernest E Vogelsinger
At 02:48 30.01.2003, Noah said:
[snip]
Yup. Restarted Apache.

PHP's still not evaluating the passed form vars whether register globals is
set to On or Off
[snip] 

Just thinking the unthinkable...

Most of the time, default settings are commented out in php.ini, like this:
; register_globals = Off

I fell into this trap sometimes by overseeing the semicolon and simply
changing the value with no effect whatsoever. Would you mind to take a look?

If this isn't the case here I don't have a clue as to what's going on...

Did you mention the version? Possibly there's a special build here that
never allows to register globals? (config gurus chime in here please)


-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup

2003-01-29 Thread Jim Lucas
then run extract($_REQUEST);  just above where you want to use the var1
var2...  and it will place all the key = value pairs into the local scope.

Jim
- Original Message -
From: Noah [EMAIL PROTECTED]
To: Philip Olson [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Wednesday, January 29, 2003 5:55 PM
Subject: Re: [PHP] Form Variables not getting passed || Apache, MySql, Win
2k Setup


 I don't want to use $_REQUEST['my_passed_variable'] at all.

 Right now when I do an sql insert on my local machine I have to use the
 following syntax:

 INSERT into tablename (field name list)
 VALUES ($_REQUEST['var1'],  $_REQUEST['var2'], $_REQUEST['var3'])

 I just want to use $var1, $var2, $var3

 --Noah

 - Original Message -
 From: Philip Olson [EMAIL PROTECTED]
 To: CF High [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Wednesday, January 29, 2003 2:23 PM
 Subject: Re: [PHP] Form Variables not getting passed || Apache, MySql, Win
 2k Setup


 
  One too many $'s in your code, use:
 
  $_REQUEST['my_passed_variable']
 
  This is how all arrays work, autoglobals are the same.
  See also:
 
  http://www.php.net/variables.external
  http://www.php.net/variables.predefined
 
  Regards,
  Philip
 
  On Wed, 29 Jan 2003, CF High wrote:
 
   Hey all.
  
   This driving me nuts:
  
   I've got Apache, MySql, and Windows 2000 running on my local
 machine.
   In order to get passed php variables evaluated, whether via a url
query
   string, or through a form post, I have to use this syntax:
  
   $_REQUEST[$my_passed_variable]
  
   I have no such problem with our hosting company servers; i.e. I can
 access
   query_string and form posted variables as $my_passed_variable.
  
   What is going on here? Is there something in php.ini that needs to be
   adjusted?
  
   Any help whatsoever here is much appreciated,
  
   --Noah
  
   --
  
  
  
  
   --
   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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup

2003-01-29 Thread Jason Wong
On Thursday 30 January 2003 09:55, Noah wrote:
 I don't want to use $_REQUEST['my_passed_variable'] at all.

 Right now when I do an sql insert on my local machine I have to use the
 following syntax:

 INSERT into tablename (field name list)
 VALUES ($_REQUEST['var1'],  $_REQUEST['var2'], $_REQUEST['var3'])

 I just want to use $var1, $var2, $var3

Are you trying to use these inside a function? If so, look up variable scope 
in the manual.

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

/*
Most people have a mind that's open by appointment only.
*/


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




Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup

2003-01-29 Thread Noah
Sure.

In the code below, class_type is passed in the query_string (e.g. 
index.php?section_id=12page_type=class_submitclass_type=apartments)

Also, below sql values are sent via a post.

 Code Snippet ***

switch($_REQUEST['class_type']) {
  
case 'apartments';
   
 dbConnect(INSERT into c_apart_data (submit_date, apart_type_id, location, 
bedrooms, rent, heat, lease, deposit, pets, phone, email, blurb)
  Values('$submit_date', '$apart_type_id', '$location', '$bedrooms', '$rent', 
'$heat', '$lease', '$deposit', '$pets', '$phone', '$email', '$blurb'));

break;

more code

**

Let me know if you need more info,

--Noah


  - Original Message - 
  From: Leif K-Brooks 
  To: Noah 
  Cc: [EMAIL PROTECTED] 
  Sent: Wednesday, January 29, 2003 2:19 PM
  Subject: Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup


  Mind giving a code snippet?

  Noah wrote:

Thanks for the pleasant acronym, Leif.

However, setting register_globals on or off makes no difference.  The
variables are still not getting evaluated

BTW works fine on my laptop (Apache, MySql, Linux)

--Noah

- Original Message -
From: Leif K-Brooks mailto:[EMAIL PROTECTED]
To: CF High mailto:[EMAIL PROTECTED]; mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 29, 2003 1:38 PM
Subject: Re: [PHP] Form Variables not getting passed || Apache, MySql, Win
2k Setup


  
RTFM!  Your problem is register_globals.

CF High wrote:


Hey all.

This driving me nuts:

   I've got Apache, MySql, and Windows 2000 running on my local machine.
In order to get passed php variables evaluated, whether via a url query
string, or through a form post, I have to use this syntax:

$_REQUEST[$my_passed_variable]

I have no such problem with our hosting company servers; i.e. I can
  
access
  
query_string and form posted variables as $my_passed_variable.

What is going on here? Is there something in php.ini that needs to be
adjusted?

Any help whatsoever here is much appreciated,

--Noah

--






  
--
The above message is encrypted with double rot13 encoding.  Any

unauthorized attempt to decrypt it will be prosecuted to the full extent of
the law.
  




  


-- 
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.





Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup

2003-01-29 Thread Ernest E Vogelsinger
At 02:55 30.01.2003, Noah said:
[snip]
I don't want to use $_REQUEST['my_passed_variable'] at all.

Right now when I do an sql insert on my local machine I have to use the
following syntax:

INSERT into tablename (field name list)
VALUES ($_REQUEST['var1'],  $_REQUEST['var2'], $_REQUEST['var3'])

I just want to use $var1, $var2, $var3
[snip] 

You can always resort to
extract($_REQUEST);


-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup

2003-01-29 Thread Jim Lucas
why would it matter if he does it just above the place that he is going to
use them?

doesn't matter if he is in a function or not.  the $_REQUEST var will always
be available.

if he calls a function then he would have to do it just inside the function
or pass it to the function.

Jim
- Original Message -
From: Jason Wong [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, January 29, 2003 2:59 PM
Subject: Re: [PHP] Form Variables not getting passed || Apache, MySql, Win
2k Setup


 On Thursday 30 January 2003 09:55, Noah wrote:
  I don't want to use $_REQUEST['my_passed_variable'] at all.
 
  Right now when I do an sql insert on my local machine I have to use the
  following syntax:
 
  INSERT into tablename (field name list)
  VALUES ($_REQUEST['var1'],  $_REQUEST['var2'], $_REQUEST['var3'])
 
  I just want to use $var1, $var2, $var3

 Are you trying to use these inside a function? If so, look up variable
scope
 in the manual.

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

 /*
 Most people have a mind that's open by appointment only.
 */


 --
 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] Form Variables not getting passed || Apache, MySql, Win 2k Setup

2003-01-29 Thread Noah
Checked out the php.ini file.

register_globals is set to On -- there is no semicolon or other character
that would cause a problem.

This might be a problem with the Apache, Win2k combination -- I don't
know..

--Noah

- Original Message -
From: Ernest E Vogelsinger [EMAIL PROTECTED]
To: Noah [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Wednesday, January 29, 2003 2:55 PM
Subject: Re: [PHP] Form Variables not getting passed || Apache, MySql, Win
2k Setup


 At 02:48 30.01.2003, Noah said:
 [snip]
 Yup. Restarted Apache.
 
 PHP's still not evaluating the passed form vars whether register globals
is
 set to On or Off
 [snip]

 Just thinking the unthinkable...

 Most of the time, default settings are commented out in php.ini, like
this:
 ; register_globals = Off

 I fell into this trap sometimes by overseeing the semicolon and simply
 changing the value with no effect whatsoever. Would you mind to take a
look?

 If this isn't the case here I don't have a clue as to what's going on...

 Did you mention the version? Possibly there's a special build here that
 never allows to register globals? (config gurus chime in here please)


 --
O Ernest E. Vogelsinger
(\)ICQ #13394035
 ^ http://www.vogelsinger.at/




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




Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup

2003-01-29 Thread Noah
H.

Sounds like resorting to extract($REQUEST) might have a downside?

Otherwise, I'll use it for now.

Thanks,

--Noah


- Original Message -
From: Ernest E Vogelsinger [EMAIL PROTECTED]
To: Noah [EMAIL PROTECTED]
Cc: Philip Olson [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, January 29, 2003 2:58 PM
Subject: Re: [PHP] Form Variables not getting passed || Apache, MySql, Win
2k Setup


 At 02:55 30.01.2003, Noah said:
 [snip]
 I don't want to use $_REQUEST['my_passed_variable'] at all.
 
 Right now when I do an sql insert on my local machine I have to use the
 following syntax:
 
 INSERT into tablename (field name list)
 VALUES ($_REQUEST['var1'],  $_REQUEST['var2'], $_REQUEST['var3'])
 
 I just want to use $var1, $var2, $var3
 [snip]

 You can always resort to
 extract($_REQUEST);


 --
O Ernest E. Vogelsinger
(\)ICQ #13394035
 ^ http://www.vogelsinger.at/




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




RE: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup

2003-01-29 Thread John W. Holmes
You never answered if this was in a function or class method. Is it? Did
you say whether it was Apache 1 or 2?

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/

 -Original Message-
 From: Noah [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, January 30, 2003 12:35 AM
 To: Ernest E Vogelsinger
 Cc: Philip Olson; [EMAIL PROTECTED]
 Subject: Re: [PHP] Form Variables not getting passed || Apache, MySql,
Win
 2k Setup
 
 H.
 
 Sounds like resorting to extract($REQUEST) might have a downside?
 
 Otherwise, I'll use it for now.
 
 Thanks,
 
 --Noah
 
 
 - Original Message -
 From: Ernest E Vogelsinger [EMAIL PROTECTED]
 To: Noah [EMAIL PROTECTED]
 Cc: Philip Olson [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Wednesday, January 29, 2003 2:58 PM
 Subject: Re: [PHP] Form Variables not getting passed || Apache, MySql,
Win
 2k Setup
 
 
  At 02:55 30.01.2003, Noah said:
  [snip]
  I don't want to use $_REQUEST['my_passed_variable'] at all.
  
  Right now when I do an sql insert on my local machine I have to use
the
  following syntax:
  
  INSERT into tablename (field name list)
  VALUES ($_REQUEST['var1'],  $_REQUEST['var2'], $_REQUEST['var3'])
  
  I just want to use $var1, $var2, $var3
  [snip]
 
  You can always resort to
  extract($_REQUEST);
 
 
  --
 O Ernest E. Vogelsinger
 (\)ICQ #13394035
  ^ http://www.vogelsinger.at/
 
 
 
 
 --
 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