473,378 Members | 1,104 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Must GET/POST Parameters Have Values? (And What is the Syntax for GET, If NOT)

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.

Jul 19 '06 #1
2 5019

David T. Ashley wrote:
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.

Jul 19 '06 #2
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:
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.
Jul 19 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: brian_mckracken | last post by:
This might not be the right group for this question, since its kind of a pure html question... Given the html construct: <form action='index.php?expand=0,10000' method='post'> Email: <input...
5
by: Randy Harris | last post by:
I'm finding working with PrtDevMode a nightmare. Is there any particular reason that Microsoft didn't simply provide a PrinterName argument for printing a report? That seems like a pretty...
4
by: Weaver | last post by:
Supposing I wanted to do something like this: Set rsB = db.OpenRecordset("qryStuff") only qryStuff required parameters? How do I pass the parameter values to the query? Thanks.
4
by: Mike Dinnis | last post by:
Hi, I've been working through a number of turorials to try to learn more about retrieving data from a SQL database. I think i've mastered techniques where i create a sql string in the page and...
21
by: Dmitry Anikin | last post by:
I mean, it's very convenient when default parameters can be in any position, like def a_func(x = 2, y = 1, z): ... (that defaults must go last is really a C++ quirk which is needed for overload...
20
by: fniles | last post by:
I am using VB.NET 2003, SQL 2000, and SqlDataReader. As I read data from tblA, I want to populate tblB. I use SQLDataReader for both tables. I do not use thread. When I ExecuteReader on tblB, I...
13
by: Bart | last post by:
Hi, i get the error: "There is already an open DataReader associated with this Command which must be closed first" Thanks Bart ----------------------------------------- Imports...
0
by: Xah Lee | last post by:
In this article, i explain how the use of bit masks is a hack in many imperative languages. Often, a function will need to take many True/False parameters. For example, suppose i have a function...
0
by: roamnet | last post by:
hi i created database file with .mdf extention ,sql server as a source and use grid view to display data there're no problem in data retrieve and display,but i want to edit it or insert new...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.