query vars
query variables
- functions.php:
add_filter('query_vars', 'wsQueryVars'); function wsQueryVars($vars) { $vars[] = 'webDesign'; //register new query vars $vars[] = 'webCoding'; //register new query vars return $vars; }
- page.php:
$webDesigbValue = sanitize_text_field(get_query_var('webDesign')); //secure version $webCodingValue = sanitize_text_field(get_query_var('webCoding')); //secure version if ( $webDesigbValue == 'good' AND $webCodingValue == 'ideal' ) { echo 'very nice website'; }
<form method="post"> <input type="text" name="webDesign"> <input type="text" name="webCoding"> <button>send</button> </form>
- url webscene.pl/about/?webDesign=good&webCoding=ideal
Hope this helps and happy coding :)
Zobacz jeszcze
HTTP requests
rodzaje żądań HTTP: GET request - zapytanie wpisane w adres przeglądarki pozwala na otrzymanie lub odebranie danych (get or receive informations) POST request - wysyła DELETE...