Re: [PHP] Re: $_GET and $_POST arrays not working

2005-11-26 Thread Andy Pieters
On Saturday 26 November 2005 02:45, John Nichel wrote:
 If you have a form like this one one page...

 form action=page2.php method=post
 input type=hidden name=foo value=bar /
 input type=submit /
 /form

[snip]

Dear John

Please go all the way when providing an example.  To prevent errors and 
unpredictable behaviour, ALWAYS add encoding to the form tag.

form action=page2.php method=post enctype=multipart/form-data 
name=form1

Systematically adding names on all your forms may save you many hours of hair 
plucking as well ;)

With kind regards


Andy

-- 
Now listening to Top! Radio Live www.topradio.be/stream on amaroK
Geek code: www.vlaamse-kern.com/geek
Registered Linux User No 379093
If life was for sale, what would be its price?
www.vlaamse-kern.com/sas/ for free php utilities
--


pgp5OYyt4uFSA.pgp
Description: PGP signature


Re: [PHP] Re: $_GET and $_POST arrays not working

2005-11-26 Thread John Nichel

 On Saturday 26 November 2005 02:45, John Nichel wrote:
 If you have a form like this one one page...

 form action=page2.php method=post
 input type=hidden name=foo value=bar /
 input type=submit /
 /form

 [snip]

 Dear John

 Please go all the way when providing an example.  To prevent errors and
 unpredictable behaviour, ALWAYS add encoding to the form tag.

 form action=page2.php method=post enctype=multipart/form-data
 name=form1

 Systematically adding names on all your forms may save you many hours of
 hair
 plucking as well ;)

Neither are required.  enctype is implied if left out, and name is only
'useful' on the client side.  Even the W3C's examples match what I posted.

http://www.w3.org/TR/html4/interact/forms.html#h-17.3

-- 
John C. Nichel IV
Programmer/System Admin
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] Re: $_GET and $_POST arrays not working

2005-11-26 Thread Unknown Unknown
Thank you, my login script started to work and i'l find some functions to
clean data properly


[PHP] Re: $_GET and $_POST arrays not working

2005-11-25 Thread Matt Monaco
In php.ini (most likely located in your windows directory) look for the 
globals section and turn register_globals = on

Matt


Unknown Unknown [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
Hello everyone, i am running PHP 5 on Windows XP Pro SP2, my $_GET and
$_POST arrays do not seem to be working, I am Sure I am spelling them right,
but i keep getting the errors:
**
*Notice*: Undefined index: Username in *
D:\Apache\Apache(re)\Apache2\htdocs\RegisterP.php* on line *3*

*Notice*: Undefined index: Password in *
D:\Apache\Apache(re)\Apache2\htdocs\RegisterP.php* on line *4*

*Notice*: Undefined index: EMail in *
D:\Apache\Apache(re)\Apache2\htdocs\RegisterP.php* on line *5*

Is this a problem with configuration or is there a bug in PHP, thanks in
advance

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



Re: [PHP] Re: $_GET and $_POST arrays not working

2005-11-25 Thread Unknown Unknown
Doesn't that cause security problems?

On 11/25/05, Matt Monaco [EMAIL PROTECTED] wrote:

 In php.ini (most likely located in your windows directory) look for the
 globals section and turn register_globals = on

 Matt


 Unknown Unknown [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
 Hello everyone, i am running PHP 5 on Windows XP Pro SP2, my $_GET and
 $_POST arrays do not seem to be working, I am Sure I am spelling them
 right,
 but i keep getting the errors:
 **
 *Notice*: Undefined index: Username in *
 D:\Apache\Apache(re)\Apache2\htdocs\RegisterP.php* on line *3*

 *Notice*: Undefined index: Password in *
 D:\Apache\Apache(re)\Apache2\htdocs\RegisterP.php* on line *4*

 *Notice*: Undefined index: EMail in *
 D:\Apache\Apache(re)\Apache2\htdocs\RegisterP.php* on line *5*

 Is this a problem with configuration or is there a bug in PHP, thanks in
 advance

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




Re[2]: [PHP] Re: $_GET and $_POST arrays not working

2005-11-25 Thread Richard Davey
Hi,

Friday, November 25, 2005, 10:43:20 PM, you wrote:

 Doesn't that cause security problems?

Yes.

Post your *whole* code, not just snippets of it.

Cheers,

Rich
-- 
Zend Certified Engineer
PHP Development Services
http://www.corephp.co.uk

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



Re: Re[2]: [PHP] Re: $_GET and $_POST arrays not working

2005-11-25 Thread Unknown Unknown
Wow somehow I fixed the error, I don't really know how... oh well


Re: [PHP] Re: $_GET and $_POST arrays not working

2005-11-25 Thread Matt Monaco
Somewhat, but its what you need to do for the post and get arrays to work. 
What you need to do is make sure check the values in the global variables 
before you use them.  For example if on one page you have a form for a user 
signup and input type=text name='userName' on the next page 
$_POST['userName'] should be checked for things like quotes and other 
characters that will alter your SQL statement before you actually INSERT 
that value into your table.


Unknown Unknown [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
Doesn't that cause security problems?

On 11/25/05, Matt Monaco [EMAIL PROTECTED] wrote:

 In php.ini (most likely located in your windows directory) look for the
 globals section and turn register_globals = on

 Matt


 Unknown Unknown [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
 Hello everyone, i am running PHP 5 on Windows XP Pro SP2, my $_GET and
 $_POST arrays do not seem to be working, I am Sure I am spelling them
 right,
 but i keep getting the errors:
 **
 *Notice*: Undefined index: Username in *
 D:\Apache\Apache(re)\Apache2\htdocs\RegisterP.php* on line *3*

 *Notice*: Undefined index: Password in *
 D:\Apache\Apache(re)\Apache2\htdocs\RegisterP.php* on line *4*

 *Notice*: Undefined index: EMail in *
 D:\Apache\Apache(re)\Apache2\htdocs\RegisterP.php* on line *5*

 Is this a problem with configuration or is there a bug in PHP, thanks in
 advance

 --
 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] Re: $_GET and $_POST arrays not working

2005-11-25 Thread adriano ghezzi
could you give us all source lines, just cut and paste ?
hy

ag.


2005/11/26, Matt Monaco [EMAIL PROTECTED]:
 Somewhat, but its what you need to do for the post and get arrays to work.
 What you need to do is make sure check the values in the global variables
 before you use them.  For example if on one page you have a form for a user
 signup and input type=text name='userName' on the next page
 $_POST['userName'] should be checked for things like quotes and other
 characters that will alter your SQL statement before you actually INSERT
 that value into your table.


 Unknown Unknown [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
 Doesn't that cause security problems?

 On 11/25/05, Matt Monaco [EMAIL PROTECTED] wrote:
 
  In php.ini (most likely located in your windows directory) look for the
  globals section and turn register_globals = on
 
  Matt
 
 
  Unknown Unknown [EMAIL PROTECTED] wrote in message
  news:[EMAIL PROTECTED]
  Hello everyone, i am running PHP 5 on Windows XP Pro SP2, my $_GET and
  $_POST arrays do not seem to be working, I am Sure I am spelling them
  right,
  but i keep getting the errors:
  **
  *Notice*: Undefined index: Username in *
  D:\Apache\Apache(re)\Apache2\htdocs\RegisterP.php* on line *3*
 
  *Notice*: Undefined index: Password in *
  D:\Apache\Apache(re)\Apache2\htdocs\RegisterP.php* on line *4*
 
  *Notice*: Undefined index: EMail in *
  D:\Apache\Apache(re)\Apache2\htdocs\RegisterP.php* on line *5*
 
  Is this a problem with configuration or is there a bug in PHP, thanks in
  advance
 
  --
  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] Re: $_GET and $_POST arrays not working

2005-11-25 Thread Unknown Unknown
I used SQLyog and it's formated corectly
though when i release it i will do that
Also i have a login script, same same problem i'l see what will work

On 11/25/05, Matt Monaco [EMAIL PROTECTED] wrote:

 Somewhat, but its what you need to do for the post and get arrays to work.
 What you need to do is make sure check the values in the global variables
 before you use them.  For example if on one page you have a form for a
 user
 signup and input type=text name='userName' on the next page
 $_POST['userName'] should be checked for things like quotes and other
 characters that will alter your SQL statement before you actually INSERT
 that value into your table.


 Unknown Unknown [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
 Doesn't that cause security problems?

 On 11/25/05, Matt Monaco [EMAIL PROTECTED] wrote:
 
  In php.ini (most likely located in your windows directory) look for the
  globals section and turn register_globals = on
 
  Matt
 
 
  Unknown Unknown [EMAIL PROTECTED] wrote in message
  news:[EMAIL PROTECTED]
  Hello everyone, i am running PHP 5 on Windows XP Pro SP2, my $_GET and
  $_POST arrays do not seem to be working, I am Sure I am spelling them
  right,
  but i keep getting the errors:
  **
  *Notice*: Undefined index: Username in *
  D:\Apache\Apache(re)\Apache2\htdocs\RegisterP.php* on line *3*
 
  *Notice*: Undefined index: Password in *
  D:\Apache\Apache(re)\Apache2\htdocs\RegisterP.php* on line *4*
 
  *Notice*: Undefined index: EMail in *
  D:\Apache\Apache(re)\Apache2\htdocs\RegisterP.php* on line *5*
 
  Is this a problem with configuration or is there a bug in PHP, thanks in
  advance
 
  --
  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] Re: $_GET and $_POST arrays not working

2005-11-25 Thread John Nichel

Matt Monaco wrote:

Somewhat, but its what you need to do for the post and get arrays to work.

snip

No.  Things like $_POST and $_GET are global arrays and work regardless 
of the register_globals setting.  The information you're handing out 
above is wrong and dangerous.


/snip
What you need to do is make sure check the values in the global variables 
before you use them.  For example if on one page you have a form for a user 
signup and input type=text name='userName' on the next page 
$_POST['userName'] should be checked for things like quotes and other 
characters that will alter your SQL statement before you actually INSERT 
that value into your table.


ie they should be sanitized.  Things like mysql_real_escape_string() or 
adding slashes (depending on your magic_quotes setting) should be done 
prior to inserting any data.  Also, you should check to ensure that it's 
the data you expect; if you only allow usernames to contain 
alpha-numeric characters, then you should check for that.  Toss is out 
if it contains something else.


Best rule of thumb:  Never trust user input, regardless of the 
register_globals setting.


--
By-Tor.com
...it's all about the Rush
http://www.by-tor.com

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



Re: [PHP] Re: $_GET and $_POST arrays not working

2005-11-25 Thread Matt Monaco
I apologize, but I've never been able to access $_POST and $_GET in any 
context whatsoever without first turning on the register globals.


John Nichel [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Matt Monaco wrote:
 Somewhat, but its what you need to do for the post and get arrays to 
 work.
 snip

 No.  Things like $_POST and $_GET are global arrays and work regardless of 
 the register_globals setting.  The information you're handing out above is 
 wrong and dangerous.

 /snip
 What you need to do is make sure check the values in the global variables 
 before you use them.  For example if on one page you have a form for a 
 user signup and input type=text name='userName' on the next page 
 $_POST['userName'] should be checked for things like quotes and other 
 characters that will alter your SQL statement before you actually INSERT 
 that value into your table.

 ie they should be sanitized.  Things like mysql_real_escape_string() or 
 adding slashes (depending on your magic_quotes setting) should be done 
 prior to inserting any data.  Also, you should check to ensure that it's 
 the data you expect; if you only allow usernames to contain alpha-numeric 
 characters, then you should check for that.  Toss is out if it contains 
 something else.

 Best rule of thumb:  Never trust user input, regardless of the 
 register_globals setting.

 -- 
 By-Tor.com
 ...it's all about the Rush
 http://www.by-tor.com 

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



Re[2]: [PHP] Re: $_GET and $_POST arrays not working

2005-11-25 Thread Richard Davey
Hi Matt,

Saturday, November 26, 2005, 12:42:16 AM, you wrote:

 I apologize, but I've never been able to access $_POST and $_GET in
 any context whatsoever without first turning on the register
 globals.

You have a seriously foobared installation of PHP then! :)

Cheers,

Rich
-- 
Zend Certified Engineer
PHP Development Services
http://www.corephp.co.uk

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



Re: [PHP] Re: $_GET and $_POST arrays not working

2005-11-25 Thread John Nichel

Matt Monaco wrote:
I apologize, but I've never been able to access $_POST and $_GET in any 
context whatsoever without first turning on the register globals.


If you have a form like this one one page...

form action=page2.php method=post
input type=hidden name=foo value=bar /
input type=submit /
/form

And this on page2.php...

?php

echo ( $_POST['foo'] );

?

And the output on page2.php is not 'bar' when you submit the form, 
something is very wrong with your install.


--
By-Tor.com
...it's all about the Rush
http://www.by-tor.com

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



Re: [PHP] Re: $_GET and $_POST arrays not working

2005-11-25 Thread Matt Monaco
Well, I turned them off and it worked as it apparently should.  It was just 
a setting I read I had to make for globals to work the first time I install 
PHP.  I've made that change ever since.
I've always wondered why these variables - which I consider really 
important, need to be turned on.

Matt

John Nichel [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Matt Monaco wrote:
 I apologize, but I've never been able to access $_POST and $_GET in any 
 context whatsoever without first turning on the register globals.

 If you have a form like this one one page...

 form action=page2.php method=post
 input type=hidden name=foo value=bar /
 input type=submit /
 /form

 And this on page2.php...

 ?php

 echo ( $_POST['foo'] );

 ?

 And the output on page2.php is not 'bar' when you submit the form, 
 something is very wrong with your install.

 -- 
 By-Tor.com
 ...it's all about the Rush
 http://www.by-tor.com 

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