Setting $_GET variables

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
developerahusain
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
Strider64
php-forum Active User
php-forum Active User
Posts: 297
Joined: Sat Mar 23, 2013 8:24 am

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)

johnj
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
  • Information
  • Who is online

    Users browsing this forum: stumboat and 7 guests