Please contact (802) 224 - 6525 for price quotes and programming support.
Follow this link for a resume of php and Mysql Programing experience
Digg This!

0 Members and 2 Guests are viewing this topic. « previous next »
Pages: [1] Go Down Print
Author Topic: error when calling google on my site.  (Read 3461 times)
lorem
Newbie
*

Karma: 0
Offline Offline

Posts: 7


View Profile
« on: June 08, 2007, 02:14:44 PM »

I'm trying to pull up google (or any site) on my site. I've tested it on my site and locally, but it still does not work. I get the same message below. I just need to be able to display these sites on my page.

Warning: include(http://google.com) [function.include]: failed to open stream: An attempt was made to access a socket in a way forbidden by its access permissions. in C:\Documents and Settings\Administrator\Desktop\googlesearch.php on line 5

Warning: include() [function.include]: Failed opening 'http://google.com' for inclusion (include_path='.;C:\php5\pear') in C:\Documents and Settings\Administrator\Desktop\googlesearch.php on line 5


Here's the code that I use for it.

Code:
1 include("http://google.com");
2 
« Last Edit: June 08, 2007, 06:20:54 PM by lorem » Logged
mya
Newbie
*

Karma: 0
Offline Offline

Posts: 2


View Profile
« Reply #1 on: June 09, 2007, 04:38:43 AM »

You can't "include" external site in includes. Try using an iframe/frame, or the curl method.

curl method:
Code:
1 $ch = curl_init();
2 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
3 curl_setopt($ch, CURLOPT_TIMEOUT, 30);
4 curl_setopt($ch, CURLOPT_URL, 'http://google.com');
5 $output = curl_exec($ch);
6 curl_close($ch);
7 print $output;
8 
Logged
Smoak24
Support Staff
Full Member
*

Karma: 2
Offline Offline

Posts: 157


View Profile
« Reply #2 on: June 12, 2007, 03:42:06 PM »

I agree, you can't include external site in includes.  Additionally, I have always had trouble with google and now use yahoo with a great deal less issues.
Logged
D.diome
Newbie
*

Karma: 0
Offline Offline

Gender: Male
Posts: 1

=http://tierussianwoman.w-ru.com/]beautiful russian[/url]


View Profile WWW
« Reply #3 on: December 04, 2009, 07:40:33 AM »

I am getting the same error message. If someone can help me I would really appreciate it. I am running a Mac with 10.4.11 OS.
Logged

=http://tierussianwoman.w-ru.com/]beautiful russian bride[/url]
John Anderson
Vermont Internet Design Admin
Administrator
Full Member
*****

Karma: 0
Offline Offline

Gender: Male
Posts: 238



View Profile WWW
« Reply #4 on: December 11, 2009, 07:08:30 PM »

Try enabling allow_url_fopen in your php.ini, than using the fopen(); function to incude the remote data.
Logged

Pages: [1] Go Up Print 
« previous next »
Jump to:  

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC
TinyPortal v0.9.8 © Bloc
Christmas2006 design by Bloc
Page created in 0.158 seconds with 29 queries.