473,388 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

file($url) problem - fulling server into thinking you're a web browser

Hi there,

I want to try and grab the HTML of a web page, but I have a little
problem - the web designer/developer of the page! He made it one of
those pages that displays "Please update your browser. This web site
does not support Netscape Naivagator version 1.234" if it "thinks"
your browser isn't up to par.

When I try to use PHP file($URL) function to grab the HTML, my request
doesn't have any header information informing the server what my web
browser is, so I get this message:

Is there any way to fool it my providing bogus meta/header information
in my request? Is there another solution?

Anyone have any ideas? Thanks in advance.

- Best regards,
Lee
Jul 17 '05 #1
1 1531
lr*****@lanl.gov (Leester) wrote in message
news:<54**************************@posting.google. com>...

Is there any way to fool it my providing bogus meta/header information
in my request?


Yes. More than one, actually. You can either use cURL:

http://www.php.net/curl

or try a homebrewed solution:

$host = 'www.yourhost.com';
$path = 'path/page.htm';
$fp = fsockopen ($host, '80');
if ($fp) {
fputs($fp, 'GET '.$path." HTTP/1.0\r\nHost: ".$host."\r\n");
fputs($fp, "User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows
NT 5.0)\r\n");
} else {
die ('Oops... Nobody home...');
}
$data = '';
while (!feof ($fp)) {
$data .= fgets ($fp, 10240);
}
fclose ($fp);

Cheers,
NC
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: staleb | last post by:
Hi My problem is like this: I have a file-server and a web-server. How do I display images that r stored on the file-server. The users only have dircet access to web-server. When I display the...
3
by: swingingming | last post by:
Hi, for 5 weeks, I finished my mdb project. Thanks to all you guys. Now, I would like to put it on a server then 5-6 people can share it. I heard about the splitting back-end database, put it on a...
3
by: Doug | last post by:
I have a split Access database that resides on a file server. The file server is a restricted drive that only people with the correct permissions can browse to this directory on the LAN. Several...
1
by: bill | last post by:
I have been asked to design a file server application. Here are the particulars: The data that is to be served is on a 80Gbyte USB drive connected to a USB 2.0 port. That disk needs to be...
1
by: Matt Hamilton | last post by:
I was hoping that someone can give me step-by-step instructions to fix the following: We would like our ASP.NET application to utilize a central file server for uploads and downloads. I have...
1
by: Henry_c_sun | last post by:
Hi, Does anyone know how to get a file url (file://host/folder/...) from a path string? On Mac there is CFURL, but on windows I cannot find this kind of function. I looked at xerces, and...
4
by: RLN | last post by:
Re: Access 2003/WinXP Pro-SP3 I have a shell command that does not run correctly. I have two programs located on a file server: Pgm1.mdb and Pgm2.mdb Pgm1 launches Pgm2 via a command button...
1
by: venky | last post by:
Hi all, Given a file url (internet url) , I need to save it on my hard disk using c++ code. Is there anyway I can do this through pure c++ ? The code needs to be portable on both windows and...
0
by: Med | last post by:
Hi, From http://dotnetguts.blogspot.com/2008/07/url-rewriting-with-urlrewriternet.html I managed to rewrite http://www.example.com/product.aspx?productname=Panasonic+TV to:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.