header('Content-Type: application/xml');  
  $tmpFile = 'tmpFile.txt';  
  $val = $_GET["http://rss.news.yahoo.com/rss/us.rss"]; 
  echo ($val); 
  $curlHandle = curl_init($val);  
  $filePointer = fopen($tmpFile, "w");  
  curl_setopt($curlHandle, CURLOPT_FILE, $filePointer);  
  $linesArr = file($tmpFile);  
  foreach($linesArr as $eachLine){  

I don't know why this code is not working. Can someone help me

Recommended Answers

What's this:

 $val = $_GET["http://rss.news.yahoo.com/rss/us.rss"];

Do you have a querystring with a parameter of that name? Sounds unlikely.

Jump to Post

I followed the link and it doesn't seem to exist.

Jump to Post

All 5 Replies

sorry for that it is realy $val = $_GET["fwd"]

the posted code is to get the content of a web site and save it in a file

Member Avatar

I followed the link and it doesn't seem to exist.

but should the code on the whole work?
when i run the code with a deffrent url it gives me the error

<b>Notice</b>:  Undefined index: https://www.google.com in <b>C:\Users\spirit\Documents\xampp\htdocs\News-Reader-Code\news-web-code\bridge2.php</b> on line <b>4</b><br />
Member Avatar

sounds like you are still using the weird key:

$val = $_GET["http://www.google.com"]; 


Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.