checking a variable being passed

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 12
Joined: Sun Jan 12, 2003 2:53 am

checking a variable being passed

Postby mpgalvin » Wed Sep 24, 2003 2:57 pm

I use forms to post values to a page, but I quite often use links for the same purpose (for example, paging a db). This means that for every

Code: Select all

if (isset($HTTP_POST_VARS['value']))

I have to have a

Code: Select all

if (isset($HTTP_GET_VARS['value']))

Is there a better way of doing this (without making the assumption that $value will always exist regardless of whether it's posted or sent in a link?

User avatar
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA

Postby Redcircle » Wed Sep 24, 2003 9:46 pm

I believe pre 4.1 $HTTP_REQUEST_VARS post 4.1 you can use the superglobal $_REQUEST.. I would reccomend the later of the two

Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 4 guests