473,399 Members | 2,146 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,399 software developers and data experts.

Unable to open a specific URL

I can open many urls with php and parse out the info I need, but not the ones on this domain (www.bobmoore.com). I have tried many different ways of getting into it (fsockopen, curl, ...) with no luck. I normally grab the entire pages contents before parsing them but here is the most simplistic example of what I am trying to do and what the results are.

This one works with www.google.com
<?php
$in_url_stream = fopen("http://www.google.com", "r");
if($in_url_stream == false){
die("Error Opening URL");
}
$buffer = fgets($in_url_stream, 1000);
echo $buffer;
?>

Results as expected - a chunk of text:
<!doctype html><html><head><meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"><title>Google</title><script>window.google={kEI:"i1EKTdHzFZu88wSt mLRG",kEXPI:"27342",kCSI:{e:"27342",ei:"i1EKTdHzFZ u88wStmLRG",expi:"27342"},ml:function(){},kHL:"en" ,time:function(){return(new Date).getTime()},log:function(a,d,


But it does not work when I change the url to www.bobmoore.com
<?php
$in_url_stream = fopen("http://www.bobmoore.com", "r");
if($in_url_stream == false){
die("Error Opening URL");
}
$buffer = fgets($in_url_stream, 1000);
echo $buffer;
?>

Results:
<b>Warning</b>: fopen(http://www.bobmoore.com) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error
in <b>PHPDocument6</b> on line <b>2</b><br />
Error Opening URL

Any help on this would be greatly appreciated.
Dec 16 '10 #1
1 3330
johny10151981
1,059 1GB
issue is related with the header

when you request for
http://www.bobmoore.com/
a redirection request is generated
The header is like below:
Expand|Select|Wrap|Line Numbers
  1. HTTP/1.0 301 Moved Permanently
  2. Location: http://www.bobmoore.com/index.htm
  3. Server: BigIP
  4. Connection: Keep-Alive
  5. Content-Length: 0
  6.  
and new location is set to
Expand|Select|Wrap|Line Numbers
  1. http://www.bobmoore.com/index.htm
  2.  
try to open
Expand|Select|Wrap|Line Numbers
  1. http://www.bobmoore.com/index.htm
  2.  
you may get somewhere
Dec 17 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Jenni | last post by:
Hi, A quick question. I have been battling with this code all morning, please help. Here is the code Dim fPath1 As String Dim fPath2 As String fPath1 = "C:\Program Files\Microsoft...
3
by: Chris | last post by:
Hello all. I have a database that I use to send email updates to people. Everything is working fine, but one suggestion I keep getting is to add a link to the automatic emails that will open up the...
1
by: adamj | last post by:
Hi people... Is it possible to, by using any means...use a button to open up a form on a particular record? If so how?
3
by: kev | last post by:
Hi folks, I have a form for registration (frmRegistration) whereby i have two buttons. One is Save which saves record using the OnClick property. I used wizard to create the save button. The...
1
by: waheed iqbal | last post by:
i am using C#.net and i want to open a specific url using windows brwoser . this is very easy to launch IE process and provide url . But url required authentication and i need to provide this...
2
jaccess
by: jaccess | last post by:
I was wondering if there is a simple way to open a specific folder from an access form button. I have a form that a user can enter a date range and either view or print reports based on the date...
1
by: Zaher Rabah | last post by:
Hi I work on a program for Real Estate. All the maps pictures are found at AutoCad Software. I want to open AutoCad from Access . Or if we can open specific file name in AutoCad. Regards
5
by: phanimadhav | last post by:
Hey giveme some idea about How to open the specific drives in my PC.Actually my requirement is i have one textbox,one button if i enter the drivename in the textbox and when ever i click On the...
2
by: eko99312 | last post by:
Let's say I have this form called Attendance List. The list was in datasheet form. In the list there were names and date checklist. The question is, I want to edit one of the names by double clicking...
1
by: Clawbeast | last post by:
So I am trying to make a database that has a bunch of tables each with a common reference of PATID. Table1 PATID Contact details etc Table2 Key PATID Questionaire answers
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.