I can open many urls with php and parse out the info I need, but not the ones on this domain (www.bobmoore.c om). 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_stre am == false){
die("Error Opening URL");
}
$buffer = fgets($in_url_s tream, 1000);
echo $buffer;
?>
Results as expected - a chunk of text:
<!doctype html><html><hea d><meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"><title>Googl e</title><script>w indow.google={k EI:"i1EKTdHzFZu 88wStmLRG",kEXP I:"27342",kCSI: {e:"27342",ei:" i1EKTdHzFZu88wS tmLRG",expi:"27 342"},ml:functi on(){},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.co m
<?php
$in_url_stream = fopen("http://www.bobmoore.co m", "r");
if($in_url_stre am == false){
die("Error Opening URL");
}
$buffer = fgets($in_url_s tream, 1000);
echo $buffer;
?>
Results:
<b>Warning</b>: fopen(http://www.bobmoore.co m) [<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.
This one works with www.google.com
<?php
$in_url_stream = fopen("http://www.google.com" , "r");
if($in_url_stre am == false){
die("Error Opening URL");
}
$buffer = fgets($in_url_s tream, 1000);
echo $buffer;
?>
Results as expected - a chunk of text:
<!doctype html><html><hea d><meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"><title>Googl e</title><script>w indow.google={k EI:"i1EKTdHzFZu 88wStmLRG",kEXP I:"27342",kCSI: {e:"27342",ei:" i1EKTdHzFZu88wS tmLRG",expi:"27 342"},ml:functi on(){},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.co m
<?php
$in_url_stream = fopen("http://www.bobmoore.co m", "r");
if($in_url_stre am == false){
die("Error Opening URL");
}
$buffer = fgets($in_url_s tream, 1000);
echo $buffer;
?>
Results:
<b>Warning</b>: fopen(http://www.bobmoore.co m) [<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.
Comment