_ga=GA1.2.1143421136.1419395036; 16acd9b63ecbf50de0b8c010c2b7289f=779l2132g7802l2fb7vkpqlh53; _gat=1; YwRuLWF1dGhfNTE4NF8xMjE3NDU=549f9d4038f6c274024048
var_dump($_COOKIE);
die(var_dump($foo));
array(0) {
}
die(var_dump($_COOKIE));
rather than my example code using $foo ?
file_put_contents('match'.time().'.txt', print_r($match, true));
Array
(
[0] => Array
(
[0] => Set-Cookie: 18acd9b62ecbf50de0b8c010c2b7289f=ftsdvqalsivpv5hb4kf3ucj1r5;
)
[1] => Array
(
[0] => 18acd9b63ecbf50de0b7c010c2b7289f=ftsdvqalsivpv6hb5kf3ucj1r5
)
[2] => Array
(
[0] => ;
)
)
var_dump($_COOKIE);
die();
var_dump($_COOKIE);
die();
array(0) {
}
function getSecurityTokens()
{
global $cookie, $videoLink, $videoId;
$old = $cookie;
file_put_contents('y'.time().'.txt', print_r($get, true));
get(SITE_URL . $videoLink);
file_put_contents('p'.time().'.txt', print_r($cookie, true));
if ($cookie == $old)
{
die('Impossible to get the tokens of the video');
Impossible to get back the tokens of the video
function getSecurityTokens()
{
// MAKE THESE THREE FUNCTION VARIABLES AVAILABLE IN THE GLOBAL SCOPE, ALSO OUTSIDE OF THIS FUNCTION
global $cookie, $videoLink, $videoId;
// COPY THE VALUE IN $cookie INTO $old (THE TWO ARE NOW EQUAL)
$old = $cookie;
// WRITE SOME INFORMATION INTO A FILE -- BUT WHAT? THE VALUE OF $get IS UNDEFINED IN THIS FUNCTION
file_put_contents('y'.time().'.txt', print_r($get, true));
// DON'T KNOW WHAT THIS DOES
get(SITE_URL . $videoLink);
// WRITE THE VALUE OF $cookie (SAME AS THE VALUE OF $old) INTO A FILE
file_put_contents('p'.time().'.txt', print_r($cookie, true));
// THIS WILL ALWAYS BE TRUE BECAUSE OF THE ASSIGNMENT ON LINE 7
if ($cookie == $old)
{
die('Impossible to get the tokens of the video');
// THE SCRIPT FAILS BECAUSE OF A PARSE ERROR HERE - THE IF AND FUNCTION STATEMENTS ARE UNTERMINATED
file_put_contents('y'.time().'.txt', print_r($get, true))
I do not understand the application requirementsI am going to try to explain at best all this to give you the real context of the script my to ask to a friend to be translated correctly
function getCookie($data)
{
preg_match_all('#Set-Cookie: ([^=]*)=([^;]*);?#mi', $data, $match);
return (empty($match[1]) ? null : implode(';', $match[1]) . '; ');
}
you requested to know the meaning of the #miSet-Cookie: ([^=]*)=([^;]*);?
And the "mi" characters are pattern modifiers. "m" means multiline so that the wildcard . can match a newline (\n) character (eg so that .* will match multiple lines rather than just up to the next \n character), and "i" means ignore case (eg so that [a-z] would also match A-Zwebsite.fr FALSE / FALSE 18acd9b63ecbf50de0b8c010c2b7289f j2ata6mfajhoiggfhrjc65je07
website.fr FALSE / FALSE 1420015619 YWRuLWF1dGhfNDU4Ml7w 54a38dd201ca6961978262
website.fr FALSE / FALSE 1420015644 YWRuLWF1dGhfNDU4Ml7xMjE3NDU 54a38dec74248260696300
.website.fr TRUE / FALSE 1483076842 _ga GA1.2.545715106.1420004811
.website.fr TRUE / FALSE 1420005410 _gat 1
var_dump($cookie, $old)
string(61) "17acd9b63ecbf50de0b8c010c2b7289f=eh8bnl4pcl6go0f67ituitr6m2; " string(61) "17acd9b63ecbf50de0b8c010c2b7289f=eh8bnl4pcl6go0f67ituitr6m2; "
i try and résult work juste one probleme on this part of code i have a (#mi) It is what. ?
Open in new window
oder cookieOpen in new window
i get a cookie just one part ( 18acd9b63ecbf50de0b7c010c2
But my script manages always not to work nevertheless you have an idea ?