NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page How to send cookies?

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search
5 members in live chat ~  


Reply
 
LinkBack Thread Tools
Old 10-24-2009, 03:15 PM THREAD STARTER               #1 (permalink)
Senior Member
Join Date: Jul 2005
Posts: 1,492
newsiness has much to be proud ofnewsiness has much to be proud ofnewsiness has much to be proud ofnewsiness has much to be proud ofnewsiness has much to be proud ofnewsiness has much to be proud ofnewsiness has much to be proud ofnewsiness has much to be proud of
 


AIDS/HIV Save a Life

How to send cookies?


PHP Code:
<?php
// this must be done somehow how you want
$filename 'mobile.php';

$handle fopen("http://us.m.yahoo.com/w/yfinance?.intl=us&.lang=en&t=ms""rb");

if(
$handle){
  
$somecontent stream_get_contents($handle);

  
$handle fopen($filename'wb');
//  $stringData = "start\n";
  
fwrite($handle$stringData);
????: NamePros.com http://www.namepros.com/programming/618770-how-to-send-cookies.html

  if(
$handle){
    if (
fwrite($handle$somecontent) === FALSE) {
       echo 
"Cannot write to file ($filename)";
       exit;
    }
    echo 
"Success, wrote ($somecontent) to file ($filename)";
//    $stringData = "end\n";
    
fwrite($handle$stringData);
    
fclose($handle);
  }else{
     echo 
"Cannot create file ($filename)";
     exit;
  }
}
chmod($filename0777);
?>
This script is used to copy the content of a page (Fallback Widget) then save it to my server as mobile.php file.

When i execute the script above, it printed this message
Quote:
The website could not set or retrieve your cookies.
The browser may not support cookies or the cookies may be turned off. Please ensure cookies are enabled and retry.
Anyone knows how to send cookies to that website so that we can copy the content of the page?
????: NamePros.com http://www.namepros.com/showthread.php?t=618770

Thanks.
__________________
||||newsiness.com||||'""|""\__,_
| _[lol]___[lol]____ l ||__|__|)
|(@)(@)"""""""**|(@)(@)**|(@) 100% Free Online Flash games
newsiness is offline   Reply With Quote
Old 10-24-2009, 04:13 PM   #2 (permalink)
Domains my Dominion
 
sdsinc's Avatar
Join Date: Aug 2005
Location: Web 1.0
Posts: 9,963
sdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatness
 


Third World Education Find Marrow Donors! Find Marrow Donors! Find Marrow Donors! Find Marrow Donors! Animal Rescue Animal Cruelty AIDS/HIV Animal Rescue Wildlife Breast Cancer Animal Rescue Wildlife
It's probably best to use the cURL functions for your purpose. You have more flexibility as you can fake the user agent and set a lot of parameters.
__________________
NameNewsletter.com - free lists of available domain names
ZoneFiles.net (beta) - ccTLD and gTLD droplists
sdsinc is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


 
All times are GMT -7. The time now is 02:32 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger