Get info from a form

Discuss the development of future releases of phpBB (phpBB 3.x minor releases) and MODing/Coding related questions.
User avatar
EY
Supporter
Supporter
Posts: 204
Joined: 05 Nov 2006, 23:13
Real name: Elias
Location: Montreal
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Get info from a form

Postby EY » 04 Aug 2008, 02:51

I was wondering if it was right to use $_POST to get info from an html form.

If not what should be used instead?
Never Say Never!

blazes816
Past Contributor
Past Contributor
Posts: 187
Joined: 07 Oct 2006, 03:00
Real name: Tyler
Location: Wichita, Kansas
Contact:

Re: Get info from a form

Postby blazes816 » 04 Aug 2008, 04:26

$_POST is fine. But ALWAYS sanitize your data anyways. :)
User Number 9e071a3a594a8964cbefe784f8a6afaa94c0de17
My MODs:

User avatar
Mr. Bond
Member
Member
Posts: 89
Joined: 30 Mar 2008, 20:34
Real name: Bobby
Location: 127.0.0.1
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Get info from a form

Postby Mr. Bond » 04 Aug 2008, 04:29

Shouldn't you use request_var() unless you are checking for submit :?:
• •

blazes816
Past Contributor
Past Contributor
Posts: 187
Joined: 07 Oct 2006, 03:00
Real name: Tyler
Location: Wichita, Kansas
Contact:

Re: Get info from a form

Postby blazes816 » 04 Aug 2008, 04:42

If in phpBB, yes, he's right you should use request_var().

(Keep forgetting this isn't a general programming forum :D )
User Number 9e071a3a594a8964cbefe784f8a6afaa94c0de17
My MODs:

User avatar
EY
Supporter
Supporter
Posts: 204
Joined: 05 Nov 2006, 23:13
Real name: Elias
Location: Montreal
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Get info from a form

Postby EY » 04 Aug 2008, 04:55

Can you please show me an example of how it should be used?
Never Say Never!

blazes816
Past Contributor
Past Contributor
Posts: 187
Joined: 07 Oct 2006, 03:00
Real name: Tyler
Location: Wichita, Kansas
Contact:

Re: Get info from a form

Postby blazes816 » 04 Aug 2008, 05:13

User Number 9e071a3a594a8964cbefe784f8a6afaa94c0de17
My MODs:

User avatar
Mr. Bond
Member
Member
Posts: 89
Joined: 30 Mar 2008, 20:34
Real name: Bobby
Location: 127.0.0.1
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Get info from a form

Postby Mr. Bond » 04 Aug 2008, 05:32

• •

User avatar
EY
Supporter
Supporter
Posts: 204
Joined: 05 Nov 2006, 23:13
Real name: Elias
Location: Montreal
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Get info from a form

Postby EY » 04 Aug 2008, 07:51

Alright thanks for the help!
Never Say Never!

User avatar
EY
Supporter
Supporter
Posts: 204
Joined: 05 Nov 2006, 23:13
Real name: Elias
Location: Montreal
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Get info from a form

Postby EY » 04 Aug 2008, 08:14

Never Say Never!

User avatar
Lord Le Brand
Website Team
Website Team
Posts: 223
Joined: 08 Sep 2006, 15:44
Real name: Leroy
Location: Parkstad, Limburg, the Netherlands (GMT+1)
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Get info from a form

Postby Lord Le Brand » 04 Aug 2008, 08:44


User avatar
EY
Supporter
Supporter
Posts: 204
Joined: 05 Nov 2006, 23:13
Real name: Elias
Location: Montreal
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Get info from a form

Postby EY » 04 Aug 2008, 08:52

Never Say Never!

User avatar
Lord Le Brand
Website Team
Website Team
Posts: 223
Joined: 08 Sep 2006, 15:44
Real name: Leroy
Location: Parkstad, Limburg, the Netherlands (GMT+1)
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Get info from a form

Postby Lord Le Brand » 04 Aug 2008, 10:52


User avatar
EY
Supporter
Supporter
Posts: 204
Joined: 05 Nov 2006, 23:13
Real name: Elias
Location: Montreal
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Get info from a form

Postby EY » 04 Aug 2008, 15:54

Alright thank you very much!
Never Say Never!

User avatar
igorw
Past Contributor
Past Contributor
Posts: 1967
Joined: 01 Jun 2006, 20:48
Real name: Igor
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Get info from a form

Postby igorw » 04 Aug 2008, 16:08


- we're poor!

User avatar
EY
Supporter
Supporter
Posts: 204
Joined: 05 Nov 2006, 23:13
Real name: Elias
Location: Montreal
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Get info from a form

Postby EY » 04 Aug 2008, 16:13

Examples on how to use request_var()?
Never Say Never!


[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Return to “phpBB Development discussion”

Who is online

Users browsing this forum: No registered users and 15 guests