Setting $_GET variables

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
New php-forum User
New php-forum User
Posts: 44
Joined: Tue May 28, 2013 10:04 pm
Location: India,Lucknow

Sat Jun 01, 2013 6:19 am

This is the best way to do it
if ($_REQUEST ['cmd'] && $_REQUEST ['cmd']== "doMining")
echo "your stuff";

Any problems do revert and do come clear. I will be able to solve your problem

User avatar
php-forum Active User
php-forum Active User
Posts: 315
Joined: Sat Mar 23, 2013 8:24 am
Location: Livonia, MI

Sat Jun 01, 2013 7:18 am

$_REQUEST is one of the biggest design weaknesses in PHP. Every application using $_REQUEST is most probably vulnerable to Delayed Cross Site Request Forgery problems. (This basically means if e.g. a cookie named (age) exists it will always overwrite the GET/POST content and therefore unwanted requests will be performed)

php-forum Super User
php-forum Super User
Posts: 1803
Joined: Thu Mar 10, 2011 5:07 pm

Sat Jun 01, 2013 8:07 am

Use a form and submit button. Pass 'cmd' as a hidden variable. In this case you can always check whether the form submit button was clicked, then get the value for the hidden variable 'cmd'.

Yes, good to avoid $_REQUEST.

Post Reply