$v_title = "The title has an apostrophe's, 2 \slashes\, an @ sign, a plus +, a tildy ~, "double quotes" and an & ampersand in it."; $v_rp = "http://www.mentalshots.com/_tests/test_urlencode_variables.php"; $v_rt = $v_title; $v_rp2 = urlencode($v_rp); $v_rt2 = urlencode($v_rt); $v_rp3 = urlencode(htmlentities($v_rp)); $v_rt3 = urlencode(htmlentities($v_rt)); $_SESSION['s_rp'] = $v_rp; $_SESSION['s_rt'] = $v_rt; $_SESSION['s_rp2'] = $v_rp2; $_SESSION['s_rt2'] = $v_rt2; $_SESSION['s_rp3'] = $v_rp3; $_SESSION['s_rt3'] = $v_rt3; // Set cookie sessions $v_expire = time()+3600*24*365; setcookie ('c_rp', $v_rp, $v_expire, '/'); setcookie ('c_rt', $v_rt, $v_expire, '/'); setcookie ('c_rp2', $v_rp2, $v_expire, '/'); setcookie ('c_rt2', $v_rt2, $v_expire, '/'); setcookie ('c_rp3', $v_rp3, $v_expire, '/'); setcookie ('c_rt3', $v_rt3, $v_expire, '/');
Link to test_urlencode_variables.php
$_SESSION[s_rp] = http://www.mentalshots.com/_tests/test_urlencode_variables.php
$_SESSION[s_rt] = The title has an apostrophe's, 2 \slashes\, an @ sign, a plus +, a tildy ~, "double quotes" and an & ampersand in it.
$_SESSION[s_rp2] = http%3A%2F%2Fwww.mentalshots.com%2F_tests%2Ftest_urlencode_variables.php
$_SESSION[s_rt2] = The+title+has+an+apostrophe%27s%2C+2++%5Cslashes%5C%2C+an+%40+sign%2C+a+plus+%2B%2C+a+tildy+%7E%2C+%22double+quotes%22+and+an+%26+ampersand+in+it.
$_SESSION[s_rp3] = http%3A%2F%2Fwww.mentalshots.com%2F_tests%2Ftest_urlencode_variables.php
$_SESSION[s_rt3] = The+title+has+an+apostrophe%27s%2C+2++%5Cslashes%5C%2C+an+%40+sign%2C+a+plus+%2B%2C+a+tildy+%7E%2C+%26quot%3Bdouble+quotes%26quot%3B+and+an+%26amp%3B+ampersand+in+it.
$_SESSION[s_rp2] decoded = http://www.mentalshots.com/_tests/test_urlencode_variables.php
$_SESSION[s_rt2] decoded = The title has an apostrophe's, 2 \slashes\, an @ sign, a plus +, a tildy ~, "double quotes" and an & ampersand in it.
$_SESSION[s_rp3] decoded = http://www.mentalshots.com/_tests/test_urlencode_variables.php
$_SESSION[s_rt3] decoded = The title has an apostrophe's, 2 \slashes\, an @ sign, a plus +, a tildy ~, "double quotes" and an & ampersand in it.
$_POST[f_rp] =
$_POST[f_rt] =
$_POST[f_rp2] =
$_POST[f_rt2] =
$_POST[f_rp3] =
$_POST[f_rt3] =
$_POST[f_rp2] decoded =
$_POST[f_rt2] decoded =
$_POST[f_rp3] decoded =
$_POST[f_rt3] decoded =
$_GET[rp] =
$_GET[rt] =
$_GET[rp2] =
$_GET[rt2] =
$_GET[rp3] =
$_GET[rt3] =
$_GET[rp2] decoded =
$_GET[rt2] decoded =
$_GET[rp3] decoded =
$_GET[rt3] decoded =
$_COOKIE[c_rp] =
$_COOKIE[c_rt] =
$_COOKIE[c_rp2] =
$_COOKIE[c_rt2] =
$_COOKIE[c_rp3] =
$_COOKIE[c_rt3] =
$_COOKIE[c_rp2] decoded =
$_COOKIE[c_rt2] decoded =
$_COOKIE[c_rp3] =
$_COOKIE[c_rt3] =