$_GET in a function in functions.php
-
Hello,
In my comments.php I inserted a form :
<form name="myForm" action="" method="GET" style="float:right" > <SELECT NAME="format"> <OPTION>Test 1 <OPTION>Test 2 </SELECT> <SELECT NAME="ordre"> <OPTION>Example 1 <OPTION>Example 2 </SELECT> <input type="submit" name="submit" value="Trier"> </form>
I want to store the selected value in a cookie, so I added this function to my functions.php :
<?php
function set_navi_cookie() {
$sc_ordre = $_REQUEST[‘ordre’];
setcookie(‘naviga’,$sc_ordre,time()+60, COOKIEPATH, COOKIE_DOMAIN, false);
}
add_action( ‘init’, ‘set_navi_cookie’);
?>but $sc_ordre is null. I tried $_REQUEST[‘ordre’]; but it’s always null.
What I did wrong ?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘$_GET in a function in functions.php’ is closed to new replies.