473,385 Members | 1,693 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,385 software developers and data experts.

Using fopen(), Curl or 'Other' to grab remote contents


Hi guys,

I have been building a search engine here - not because I have plans of
dethrowning Google but as a simple app upon which to develop a function
set that I can use for other things.

So I coded my little search engine, uploaded it and it didn't work with
my host (Dreamhost.com):

Warning: fopen(): URL file-access is disabled in the server
configuration

There is no way around this. Maybe I am a fool but when I am creating
apps I like to have as little configuration requirements as possible --
in my mind it means more people can use my stuff. In this app I use
fopen to go off and grab the page contents from which I extract the
meta tags, strip away all the HTML tags, headers, and javascript and
store what I need to.

I did the above without using fragile weak get_meta_tags and have my
own version of get_headers - because its a PHP5 function only, and
because I dont like the idea of a page making multiple connections to a
site.

Essentially my functions will work if I can grab the entire page
contents and throw them into a variable which I in turn pass.

Is there a way of doing this without using fopen and curl??

I'm going to have to write a wrapper for my functions as it is so this
works seemlessly regardless of the method used - I will include Curl in
this however as mentioned earlier I prefer not to have to use extra
extensions.

Is it common for fopen to be disabled for remote content? Or do I just
have an over zealous admin staff.

I was planning on using these function with XML files down the road...
this is the core of everything I am doing.

Help/Advice appreciated

Aug 21 '05 #1
3 4517
James wrote:
Hi guys,

I have been building a search engine here - not because I have plans of
dethrowning Google but as a simple app upon which to develop a function
set that I can use for other things.

So I coded my little search engine, uploaded it and it didn't work with
my host (Dreamhost.com):

Warning: fopen(): URL file-access is disabled in the server
configuration

There is no way around this. Maybe I am a fool but when I am creating
apps I like to have as little configuration requirements as possible --
in my mind it means more people can use my stuff. In this app I use
fopen to go off and grab the page contents from which I extract the
meta tags, strip away all the HTML tags, headers, and javascript and
store what I need to.
<snip>
Is it common for fopen to be disabled for remote content? Or do I just
have an over zealous admin staff.


Not sure about common, but the wespace provided by my ISP has the same
kind of restrictions on accessing off-site material.

http://www.blueyonder.co.uk/blueyond...d_restrictions

Maybe there's an equivalent page for your provider?

--
Steve.
Aug 21 '05 #2
James wrote:

Hi guys,
<snip>
Warning: fopen(): URL file-access is disabled in the server
configuration


Yup - check you can use fsockopen() and roll your own HTTP stack. If this
sounds too scary you could try phpclasses.org or freshmeat.net as I'm sure
there may already be code available for PHP to do this already (Snoopy?).

BTW: why write your own search engine? Check out MnoGo.

C.
Aug 21 '05 #3
As I mentioned :D so I have a foundation to build some functions -- not
grandeous plans, no de-throwning of google :D --

Aug 22 '05 #4

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

Similar topics

5
by: Grant | last post by:
Hi, I'm trying to use fopen to open a remote page. I found a page that doesn't work, and it's because the page requires cookies. Is there a way in PHP to pass cookies to a remote host? Here...
0
by: Phil Powell | last post by:
What is the most standardized method of utilizing the CURL functions in PHP (version 4.3.2) to be able to retrieve the contents of a remote URL that happens to be dependent upon $_SESSION for its...
5
by: David Rasmussen | last post by:
Some sites seem to be session driven in the sense that if I visit the homepage and do a few clicks I can navigate anywhere I want, but if I paste the current location into a new browser window...
5
by: Charlie King | last post by:
I'm trying to send data to a remote script (a credit card processing third party) from my site using POST. Currently, I'm doing it using the ususal form dynamically built with my values. This...
1
by: devranger | last post by:
Hello, I am in the process of learning PHP CURL and in doing some test examples I am having some issues with CURL that I do not fully understand. I am doing a test to use CURL to post and return...
9
by: devranger | last post by:
I am using the below CURL Function and can not figure out why it is not retruning the results from the post. Can anyone take a look and tell me what I may be doing wrong? I am just not seeing...
3
by: JDS | last post by:
So, I'd like to create the following scenario: 1) Use cURL library within PHP (cURL + "Cookie Jar", et.al) to create a virtual browser session that "logs in" to a remote site. (For example: ...
3
by: Sarah | last post by:
I was wondering if someone might be able to help me with this issue. I have a feeling this has something to do with my host's server settings as I used to be able to get CURL to follow redirects by...
3
by: buzz2050 | last post by:
Hi all, I am using cURL for the first time. I need to login to a site and my cURL code to do the same is as follows: //curlScript.php <?php function getContent($url, $referer,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.