How do you get a GET protein variable?



  • Reference <a href="page.php?del=test test">link</a>In PHP, I'll catch catch her from $_GET["del"] I'm trying to remove the text field from the base. test test but the field is not removed! From the phpMyAdmin manually, this request is correctly handled by me, and I concluded that the text was stored in the US-GET[ &quot;del &quot; How do you get out of this situation?

    The request for the database is: "DELETE FROM services WHERE service=$_GET[del]"



  • Normally, the text with gaps and other non-requirementable symbols is codified or by a function rawurlencode()which replaces the gap in sequence \%20or by function urlencode()that replaces the pros. In this case, the data can be correctly transmitted through the GET parameter.

    $del = rawurlencode('test test');
    echo '<a href="page.php?del='.$del.'">link</a>';
    

    Modern browsers and servers usually decode themselves. However, if you need to decode data on your own for reasons, there is a reverse for each of the above functions: rawurldecode() and rawdecode()respectively.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2