Forums

PHP

This topic is locked

POST method vs GET method

Posted 03 Nov 2001 16:07:42
1
has voted
03 Nov 2001 16:07:42 Michael Davis posted:
I'm very new to UD and PHP/MySql.
I'm using PhaKt, and I have a database with 100 records, and I want to display 25 records per page, with a nav bar at bottom (first, next,etc).

I never was able to get the nav bar to work until I noticed that my form was using "POST" for the original search, and the nav bar was using "GET". When I changed my form to use the "GET" method, everything worked fine.

Is their any reason to use post vs get? Security issues, performance etc?
How would I change the nav bar behavior to "POST", or should I leave it?

TIA for any help!

Replies

Replied 03 Nov 2001 17:50:03
03 Nov 2001 17:50:03 Tim Green replied:
The Navbar uses get variables as they do not impede on security in this case. The get variables pass the offset positions for the repeat region and the moveTo behaviours. Nothing more. So there are no security implications in it's application.

As PHP is quite happy sending both GET and POST variables at the same time, I often use a POST form within such a region without issue. However, you must ensure that your script is properly grabbing the values from the submissions.

Many programmers use the shorthand method for retrieving GET and POST variable values (ie prefix a $ to the name of the variable).
In situations where you are using a combination of submission methods you MUST use the GLOBAL arrays $HTTP_POST_VARS["variableName"] and $HTTP_GET_VARS["variableName"]. Otherwise the value can be overwritten unintentionally.

Hope this helps.

Tim Green

Extension & PHP TalkZone Manager
<font size=1>-------------------------------------------
<i>Please read the Forum FAQ before posting
a question to this TalkZone.</i>
-------------------------------------------
www.UDzone.com : A dynamic Dreamweaver,
Ultradev and Fireworks site for developers
by developers.
-------------------------------------------</font id=size1>

Reply to this topic