Page 1 of 1

Setting the cookies in PHP

Posted: Sat Mar 21, 2009 7:51 am
by zerandib
hi,

i want to read the source code of redtube.com (the page where videos resides)
but when visit to redtube.com , it need to confirm a certain condition.
(so i want to by pass that condition and read the source of the redtube.com video web page)

how to do such a thing....
(i need to by pass that cookie and read the full source)

when i do like this.... it only shows the source of the welcome screen.
(where, we need to confirm the message.... ex: Enter/Leave)

Code: Select all

<?php
$fh = fopen("http://www.redtube.com", "r");
$fullstring;
while(!feof($fh))
{
    $output = htmlspecialchars(fgets($fh, 1024));
    #echo ("$output");
    $fullstring = $fullstring."".$output;
   
}
echo $fullstring;
?>

Re: Setting the cookies in PHP

Posted: Wed Mar 25, 2009 9:49 am
by Darkzaelus
So basically you're a minor and want to view porn?

By the by, you arent going to get to the content without setting the cookie.
And the domain of the cookie is set up for redtube.com.
I may not know too much about cookies as i rarely use them, but im pretty confident you can't modify another site's cookie through PHP.

EDIT:
Better PHP code below :wink:

Code: Select all

<?php
$fh = fopen('http://www.redtube.com', 'r');
$fullstring='';
while(!feof($fh))
{
    $output = htmlspecialchars(fgets($fh, 1024));
    $fullstring .= $output;
   
}
echo $fullstring;
?>