Setting the cookies in PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
zerandib
Forum Newbie
Posts: 16
Joined: Tue Dec 16, 2008 12:17 am

Setting the cookies in PHP

Post 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;
?>
Darkzaelus
Forum Commoner
Posts: 94
Joined: Tue Sep 09, 2008 7:02 am

Re: Setting the cookies in PHP

Post 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;
?>
 
Post Reply