niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
· nixdoc.net · man pages · Linux HOWTOs · FreeBSD Tips · Forums
navigation Forum index » Programming » PHP
Must GET/POST Parameters Have Values? (And What is the Syntax for GET, If NOT)
Post new topic   Reply to topic Page 1 of 1 [3 Posts] View previous topic :: View next topic
Author Message
Blayde
*nix forums beginner


Joined: 19 Jul 2006
Posts: 1

PostPosted: Wed Jul 19, 2006 6:44 pm    Post subject: Re: Must GET/POST Parameters Have Values? (And What is the Syntax for GET, If NOT) Reply with quote

I've used like your first example (no equals signs) with no problems
many times. All one must do to see if it is there is:

isset($_GET['this'])

I use this to get different pages from the same php script
-Blayde

David T. Ashley wrote:
Quote:
Are GET and POST parameters required to have values, i.e. are either of
these legal?

http://www.mydomain.com/index.php?this&that

http://www.mydomain.com/index.php?this=&that=

In my application, I have a GET/POST parameter that is significant just by
its presence (it doesn't need a value), and rather than say this=1&that=1 I
was wondering if it is legal to specify them without values.

Thanks, Dave.
Back to top
flamer
*nix forums beginner


Joined: 06 Jul 2006
Posts: 36

PostPosted: Wed Jul 19, 2006 1:13 am    Post subject: Re: Must GET/POST Parameters Have Values? (And What is the Syntax for GET, If NOT) Reply with quote

David T. Ashley wrote:

Quote:
Are GET and POST parameters required to have values, i.e. are either of
these legal?

http://www.mydomain.com/index.php?this&that

http://www.mydomain.com/index.php?this=&that=

In my application, I have a GET/POST parameter that is significant just by
its presence (it doesn't need a value), and rather than say this=1&that=1 I
was wondering if it is legal to specify them without values.

Thanks, Dave.

yes thats ok, but they need an equals sign at the end still like in
your second example, i havent tried it without, also
empty($_GET['this']) this is fine if you simply want to see if it
doesnt have another value, i use stuff like this for links to member
logins, that way they can be returned back to the same page after a
successful login and ensure everything was there that was before.

Flamer.
Back to top
David T. Ashley
*nix forums Guru Wannabe


Joined: 21 Jan 2005
Posts: 124

PostPosted: Wed Jul 19, 2006 1:10 am    Post subject: Must GET/POST Parameters Have Values? (And What is the Syntax for GET, If NOT) Reply with quote

Are GET and POST parameters required to have values, i.e. are either of
these legal?

http://www.mydomain.com/index.php?this&that

http://www.mydomain.com/index.php?this=&that=

In my application, I have a GET/POST parameter that is significant just by
its presence (it doesn't need a value), and rather than say this=1&that=1 I
was wondering if it is legal to specify them without values.

Thanks, Dave.
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [3 Posts] View previous topic :: View next topic
The time now is Fri Jul 30, 2010 2:55 am | All times are GMT
navigation Forum index » Programming » PHP
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Why did the moron post CD4? Nog Suse 0 Fri Jul 21, 2006 2:13 pm
No new posts positional parameters of a var SumGuy shell 5 Fri Jul 21, 2006 12:38 am
No new posts AIX parameters for Oracle Vincent M Server 2 Thu Jul 20, 2006 6:58 pm
No new posts does the default constructor initialize values? NewToCPP C++ 12 Thu Jul 20, 2006 3:37 pm
No new posts Invalid syntax with STD() function when more than one fie... William Bronsema MySQL 1 Thu Jul 20, 2006 2:18 pm

Copyright © 2004-2005 DeniX Solutions SRL   Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum |  Privacy Policy



Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0794s ][ Queries: 18 (0.0528s) ][ GZIP on - Debug on ]