|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25643 Unable to retrive page content using "Join" function
Submitted: 2003-09-24 09:10 UTC Modified: 2003-09-24 09:40 UTC
From: btanweer at hotmail dot com Assigned:
Status: Not a bug Package: Arrays related
PHP Version: 4.3.1 OS: Linux
Private report: No CVE-ID: None
 [2003-09-24 09:10 UTC] btanweer at hotmail dot com
I have written few lines of code to retrive data from Google. It simply reads the Google search page and then creates an array of all search listings. This code works on my local machine with Php 4.3.2 in windows but it does not return any result on my webserver with Php 4.3.1 in linux. It does not give any error message.

Reproduce code:
$page = @join("",file("$pagex&sa=N"));
#- Fetch the page and remove newlines
$page = str_replace("\n","",$page);

#- Grab all the website listed on the page
preg_match_all('/<p class=g><a href=(.*?)>(.*?)<\/a><br><font size=-1>.*?(.*?)<br>.*?(.*?)<br>/',$page,$matches);	

$number = count($matches[3]);	

	$url = strip_tags($matches[1][$x]);
        $title = str_replace("...","",strip_tags($matches[2][$x]));
        $description = str_replace("...","",strip_tags($matches[3][$x]) );
	$description1 = str_replace("...","",strip_tags($matches[4][$x],"..."));

#- print all the links from array
	print "<font size=\"+0\"><a href=$url target=_self class=\"cnn\">$title</a><br>$description$description1</font><p>\n";



Expected result:
It should display list of search results as seen in Google. For Example:
Title: Travelocity: Airline Tickets, Hotels, Cars, Vacations, and 
Decription: Business Travel Center. Save your company money. Find out how. Alreadya user? Sign-in. Travel Information Center. Departures & Arrivals. 

Title: Expedia Travel -- discount airfare, flights, hotels, cars, 
Description: is the premier online travel planning and flight-bookingsite. Purchase airline tickets online, find vacation packages 

Actual result:
Blank Page

It does not display any error or results at all


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-09-24 09:40 UTC]
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

This is not support forum for your common scripting problems.
(there is no bug here in anything but your code)

PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat May 28 17:05:46 2022 UTC