How to keep already-set GET parameter values on form submission?

后端 未结 7 875
广开言路
广开言路 2020-12-17 08:10

I have a URL : foo.php?name=adam&lName=scott, and in foo.php I have a form which gives me values of rectangleLength & re

7条回答
  •  不知归路
    2020-12-17 08:30

    My personal preference would be to specify the keys you wish to accept and be sure to run the value through htmlspecialchars().

    $url_params = array(
      'tab'
    );
    foreach( $url_params as $key ) {
      echo !empty( $_GET[$key] ) ? '' : '';
    }
    

提交回复
热议问题