Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

checking a variable being passed

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

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?
mpgalvin
New php-forum User
New php-forum User
 
Posts: 12
Joined: Sun Jan 12, 2003 2:53 am

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
User avatar
Redcircle
Moderator
Moderator
 
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA


Return to PHP coding => General

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Yahoo [Bot] and 5 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.